diff --git a/resources/sound/zomboni.ogg b/resources/sound/zomboni.ogg new file mode 100644 index 0000000..36bab88 Binary files /dev/null and b/resources/sound/zomboni.ogg differ diff --git a/source/component/plant.py b/source/component/plant.py index 5676770..e0729d4 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -24,7 +24,7 @@ class Car(pg.sprite.Sprite): self.current_time = game_info[c.CURRENT_TIME] if self.state == c.WALK: self.rect.x += 4 - if self.rect.x > c.SCREEN_WIDTH + 40: + if self.rect.x > c.SCREEN_WIDTH + 60: self.dead = True def setWalk(self): @@ -104,7 +104,7 @@ class Bullet(pg.sprite.Sprite): if self.y_vel * (self.dest_y - self.rect.y) < 0: self.rect.y = self.dest_y self.rect.x += self.x_vel - if self.rect.x >= c.SCREEN_WIDTH + 40: + if self.rect.x >= c.SCREEN_WIDTH + 60: self.kill() elif self.state == c.EXPLODE: if (self.current_time - self.explode_timer) > 250: @@ -206,7 +206,7 @@ class StarBullet(Bullet): else: self.rect.x -= 10 self.handleMapYPosition() - if ((self.rect.x > c.SCREEN_WIDTH + 40) or (self.rect.x < -20) + if ((self.rect.x > c.SCREEN_WIDTH + 60) or (self.rect.x < -40) or (self.rect.y > c.SCREEN_HEIGHT) or (self.rect.y < 0)): self.kill() elif self.state == c.EXPLODE: diff --git a/source/component/zombie.py b/source/component/zombie.py index 3c9e3d7..52ec289 100755 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -941,6 +941,8 @@ class Zomboni(Zombie): self.IceFrozenPlot = IceFrozenPlot self.die_animate_interval = 100 self.boomDie_animate_interval = 150 + # 播放冰车生成音效 + pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "zomboni.ogg")).play() def loadImages(self): self.walk_frames = [] diff --git a/source/constants.py b/source/constants.py index 46dd37f..239a3cc 100755 --- a/source/constants.py +++ b/source/constants.py @@ -1,7 +1,7 @@ # 冒险模式起始关卡 -START_LEVEL_NUM = 1 +START_LEVEL_NUM = 0 # 小游戏模式起始关卡 -START_LITTLE_GAME_NUM = 1 +START_LITTLE_GAME_NUM = 0 # 窗口标题 ORIGINAL_CAPTION = 'pypvz' @@ -349,7 +349,7 @@ ZOMBIE_ATTACK_DAMAGE = 50 ZOMBIE_WALK_INTERVAL = 60 # 僵尸步行间隔 # 僵尸生成位置 -ZOMBIE_START_X = SCREEN_WIDTH + 40 # 场宽度不一样,用于拟合 +ZOMBIE_START_X = SCREEN_WIDTH + 50 # 场宽度不一样,用于拟合 # 状态类型 IDLE = 'idle' diff --git a/source/state/level.py b/source/state/level.py index fb1a099..75beb2b 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -840,6 +840,7 @@ class Level(tool.State): # 撑杆跳生成位置不同 self.zombie_groups[map_y].add(zombie.PoleVaultingZombie(c.ZOMBIE_START_X + randint(70, 80) + hugeWaveMove, y, self.head_group)) elif name == c.ZOMBONI: + # 冰车僵尸生成位置不同 self.zombie_groups[map_y].add(zombie.Zomboni(c.ZOMBIE_START_X + randint(55, 65) + hugeWaveMove, y, self.plant_groups[map_y], self.map, plant.IceFrozenPlot)) # 能否种植物的判断: