增加报纸僵尸疑惑时间;增加报纸撕裂音效;增加潜水僵尸部分素材
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/sound/newspaperRip.ogg
Normal file
@ -191,10 +191,6 @@ class Zombie(pg.sprite.Sprite):
|
|||||||
if self.helmetType2Health <= 0 and self.helmetType2:
|
if self.helmetType2Health <= 0 and self.helmetType2:
|
||||||
self.changeFrames(self.walk_frames)
|
self.changeFrames(self.walk_frames)
|
||||||
self.helmetType2 = False
|
self.helmetType2 = False
|
||||||
if self.name == c.NEWSPAPER_ZOMBIE:
|
|
||||||
self.speed = 2.5
|
|
||||||
# 触发报纸僵尸暴走音效
|
|
||||||
pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "newspaperZombieAngry.ogg")).play()
|
|
||||||
if (self.current_time - self.walk_timer) > (c.ZOMBIE_WALK_INTERVAL * self.getTimeRatio()):
|
if (self.current_time - self.walk_timer) > (c.ZOMBIE_WALK_INTERVAL * self.getTimeRatio()):
|
||||||
self.walk_timer = self.current_time
|
self.walk_timer = self.current_time
|
||||||
if self.is_hypno:
|
if self.is_hypno:
|
||||||
@ -629,6 +625,7 @@ class FlagZombie(Zombie):
|
|||||||
class NewspaperZombie(Zombie):
|
class NewspaperZombie(Zombie):
|
||||||
def __init__(self, x, y, head_group):
|
def __init__(self, x, y, head_group):
|
||||||
Zombie.__init__(self, x, y, c.NEWSPAPER_ZOMBIE, head_group, helmetType2Health=c.NEWSPAPER_HEALTH)
|
Zombie.__init__(self, x, y, c.NEWSPAPER_ZOMBIE, head_group, helmetType2Health=c.NEWSPAPER_HEALTH)
|
||||||
|
self.speedUp = False
|
||||||
|
|
||||||
def loadImages(self):
|
def loadImages(self):
|
||||||
self.helmet_walk_frames = []
|
self.helmet_walk_frames = []
|
||||||
@ -637,6 +634,7 @@ class NewspaperZombie(Zombie):
|
|||||||
self.attack_frames = []
|
self.attack_frames = []
|
||||||
self.losthead_walk_frames = []
|
self.losthead_walk_frames = []
|
||||||
self.losthead_attack_frames = []
|
self.losthead_attack_frames = []
|
||||||
|
self.lostnewspaper_frames = []
|
||||||
self.die_frames = []
|
self.die_frames = []
|
||||||
self.boomdie_frames = []
|
self.boomdie_frames = []
|
||||||
|
|
||||||
@ -646,18 +644,21 @@ class NewspaperZombie(Zombie):
|
|||||||
attack_name = self.name + 'NoPaperAttack'
|
attack_name = self.name + 'NoPaperAttack'
|
||||||
losthead_walk_name = self.name + 'LostHead'
|
losthead_walk_name = self.name + 'LostHead'
|
||||||
losthead_attack_name = self.name + 'LostHeadAttack'
|
losthead_attack_name = self.name + 'LostHeadAttack'
|
||||||
|
lostnewspaper_name = self.name + 'LostNewspaper'
|
||||||
die_name = self.name + 'Die'
|
die_name = self.name + 'Die'
|
||||||
boomdie_name = c.BOOMDIE
|
boomdie_name = c.BOOMDIE
|
||||||
|
|
||||||
frame_list = [self.helmet_walk_frames, self.helmet_attack_frames,
|
frame_list = [self.helmet_walk_frames, self.helmet_attack_frames,
|
||||||
self.walk_frames, self.attack_frames, self.losthead_walk_frames,
|
self.walk_frames, self.attack_frames, self.losthead_walk_frames,
|
||||||
self.losthead_attack_frames, self.die_frames, self.boomdie_frames]
|
self.losthead_attack_frames, self.lostnewspaper_frames,
|
||||||
|
self.die_frames, self.boomdie_frames]
|
||||||
name_list = [helmet_walk_name, helmet_attack_name,
|
name_list = [helmet_walk_name, helmet_attack_name,
|
||||||
walk_name, attack_name, losthead_walk_name,
|
walk_name, attack_name, losthead_walk_name,
|
||||||
losthead_attack_name, die_name, boomdie_name]
|
losthead_attack_name, lostnewspaper_name,
|
||||||
|
die_name, boomdie_name]
|
||||||
|
|
||||||
for i, name in enumerate(name_list):
|
for i, name in enumerate(name_list):
|
||||||
if name == c.BOOMDIE:
|
if name in {c.BOOMDIE, lostnewspaper_name}:
|
||||||
color = c.BLACK
|
color = c.BLACK
|
||||||
else:
|
else:
|
||||||
color = c.WHITE
|
color = c.WHITE
|
||||||
@ -665,6 +666,54 @@ class NewspaperZombie(Zombie):
|
|||||||
|
|
||||||
self.frames = self.helmet_walk_frames
|
self.frames = self.helmet_walk_frames
|
||||||
|
|
||||||
|
def walking(self):
|
||||||
|
if self.checkToDie(self.losthead_walk_frames):
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.helmetType2Health <= 0 and self.helmetType2:
|
||||||
|
self.changeFrames(self.lostnewspaper_frames)
|
||||||
|
self.helmetType2 = False
|
||||||
|
# 触发报纸撕裂音效
|
||||||
|
pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "newspaperRip.ogg")).play()
|
||||||
|
if (self.current_time - self.walk_timer) > (c.ZOMBIE_WALK_INTERVAL * self.getTimeRatio()):
|
||||||
|
self.walk_timer = self.current_time
|
||||||
|
if self.frames == self.lostnewspaper_frames:
|
||||||
|
pass
|
||||||
|
elif self.is_hypno:
|
||||||
|
self.rect.x += 1
|
||||||
|
else:
|
||||||
|
self.rect.x -= 1
|
||||||
|
|
||||||
|
def animation(self):
|
||||||
|
if self.state == c.FREEZE:
|
||||||
|
self.image.set_alpha(192)
|
||||||
|
return
|
||||||
|
|
||||||
|
if (self.current_time - self.animate_timer) > (self.animate_interval * self.getTimeRatio()):
|
||||||
|
self.frame_index += 1
|
||||||
|
if self.frame_index >= self.frame_num:
|
||||||
|
if self.state == c.DIE:
|
||||||
|
self.kill()
|
||||||
|
return
|
||||||
|
elif self.frames == self.lostnewspaper_frames and (not self.speedUp):
|
||||||
|
self.changeFrames(self.walk_frames)
|
||||||
|
self.speedUp = True
|
||||||
|
self.speed = 2.65
|
||||||
|
# 触发报纸僵尸暴走音效
|
||||||
|
pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "newspaperZombieAngry.ogg")).play()
|
||||||
|
return
|
||||||
|
self.frame_index = 0
|
||||||
|
self.animate_timer = self.current_time
|
||||||
|
|
||||||
|
self.image = self.frames[self.frame_index]
|
||||||
|
if self.is_hypno:
|
||||||
|
self.image = pg.transform.flip(self.image, True, False)
|
||||||
|
self.mask = pg.mask.from_surface(self.image)
|
||||||
|
if (self.current_time - self.hit_timer) >= 200:
|
||||||
|
self.image.set_alpha(255)
|
||||||
|
else:
|
||||||
|
self.image.set_alpha(192)
|
||||||
|
|
||||||
class FootballZombie(Zombie):
|
class FootballZombie(Zombie):
|
||||||
def __init__(self, x, y, head_group):
|
def __init__(self, x, y, head_group):
|
||||||
Zombie.__init__(self, x, y, c.FOOTBALL_ZOMBIE, head_group, helmetHealth=c.FOOTBALL_HELMET_HEALTH)
|
Zombie.__init__(self, x, y, c.FOOTBALL_ZOMBIE, head_group, helmetHealth=c.FOOTBALL_HELMET_HEALTH)
|
||||||
|
|||||||