加入冰车僵尸生成音效
This commit is contained in:
parent
625658202a
commit
245cc0fb4f
BIN
resources/sound/zomboni.ogg
Normal file
BIN
resources/sound/zomboni.ogg
Normal file
Binary file not shown.
@ -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:
|
||||
|
||||
@ -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 = []
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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))
|
||||
|
||||
# 能否种植物的判断:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user