diff --git a/README.md b/README.md index 5c906b1..931dd1c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ **本项目为个人python语言学习的练习项目,仅供个人学习和研究使用,不得用于其他用途。如果这个游戏侵犯了版权,请联系我删除** * 已有的植物:向日葵,豌豆射手,坚果墙,寒冰射手,樱桃炸弹,三线射手,大嘴花,小喷菇,土豆雷,地刺,胆小菇,倭瓜,火爆辣椒,阳光菇,寒冰菇,魅惑菇,火炬树桩,睡莲,杨桃,咖啡豆,海蘑菇 -* 已有的僵尸:普通僵尸,旗帜僵尸,路障僵尸,铁桶僵尸,读报僵尸,橄榄球僵尸,鸭子救生圈僵尸 +* 已有的僵尸:普通僵尸,旗帜僵尸,路障僵尸,铁桶僵尸,读报僵尸,橄榄球僵尸,鸭子救生圈僵尸,铁门僵尸 * 使用 JSON 文件记录关卡信息数据 * 支持选择植物卡片 * 支持白昼模式,夜晚模式,泳池模式,传送带模式和坚果保龄球模式 diff --git a/resources/data/entity/zombie.json b/resources/data/entity/zombie.json index de540fc..fe26077 100644 --- a/resources/data/entity/zombie.json +++ b/resources/data/entity/zombie.json @@ -31,6 +31,8 @@ "ConeheadDukyTubeZombieSwim":{"x":55, "width":105}, "BucketheadDukyTubeZombie":{"x":55, "width":105}, "BucketheadDukyTubeZombieAttack":{"x":55, "width":105}, - "BucketheadDukyTubeZombieSwim":{"x":55, "width":105} + "BucketheadDukyTubeZombieSwim":{"x":55, "width":105}, + "ScreenDoorZombie":{"x":41, "width":100}, + "ScreenDoorZombieAttack":{"x":41, "width":100} } } \ No newline at end of file diff --git a/resources/data/map/level_0.json b/resources/data/map/level_0.json index 7a173d0..486255c 100644 --- a/resources/data/map/level_0.json +++ b/resources/data/map/level_0.json @@ -4,7 +4,7 @@ "shovel":1, "spawn_zombies":"list", "zombie_list":[ - {"time":0, "map_y":3, "name":"BucketheadDuckyTubeZombie"}, + {"time":0, "map_y":4, "name":"ScreenDoorZombie"}, {"time":0, "map_y":2, "name":"ConeheadDuckyTubeZombie"}, {"time":60000, "map_y":2, "name":"Zombie"} ] diff --git a/resources/data/map/level_3.json b/resources/data/map/level_3.json index a038a80..ca3da02 100644 --- a/resources/data/map/level_3.json +++ b/resources/data/map/level_3.json @@ -3,7 +3,7 @@ "init_sun_value":50, "shovel":1, "spawn_zombies":"auto", - "included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie"], + "included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "ScreenDoorZombie"], "inevitable_zombie_list":{"20":["BucketheadZombie"]}, "num_flags":3 } diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_0.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_0.png deleted file mode 100644 index 4542be4..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_0.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_1.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_1.png deleted file mode 100644 index b05ebac..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_1.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_10.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_10.png deleted file mode 100644 index a62b2ae..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_10.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_11.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_11.png deleted file mode 100644 index 24eb23d..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_11.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_12.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_12.png deleted file mode 100644 index d1b62a8..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_12.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_13.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_13.png deleted file mode 100644 index f78d8ac..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_13.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_14.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_14.png deleted file mode 100644 index 53f0fdf..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_14.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_2.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_2.png deleted file mode 100644 index 875016d..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_2.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_3.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_3.png deleted file mode 100644 index 5652e84..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_3.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_4.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_4.png deleted file mode 100644 index ab614b9..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_4.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_5.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_5.png deleted file mode 100644 index 16764af..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_5.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_6.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_6.png deleted file mode 100644 index 2068734..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_6.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_7.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_7.png deleted file mode 100644 index aee047b..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_7.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_8.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_8.png deleted file mode 100644 index d89e329..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_8.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_9.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_9.png deleted file mode 100644 index 590f17b..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHead/ScreenDoorZombieLostHead_9.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_0.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_0.png deleted file mode 100644 index f29f704..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_0.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_1.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_1.png deleted file mode 100644 index f8549a0..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_1.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_10.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_10.png deleted file mode 100644 index c2e053f..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_10.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_11.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_11.png deleted file mode 100644 index 43e1e96..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_11.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_2.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_2.png deleted file mode 100644 index 4338a74..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_2.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_3.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_3.png deleted file mode 100644 index 91a4bdd..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_3.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_4.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_4.png deleted file mode 100644 index c686cef..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_4.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_5.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_5.png deleted file mode 100644 index 149986a..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_5.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_6.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_6.png deleted file mode 100644 index 1bab25a..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_6.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_7.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_7.png deleted file mode 100644 index 0a10aff..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_7.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_8.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_8.png deleted file mode 100644 index b0d6b33..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_8.png and /dev/null differ diff --git a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_9.png b/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_9.png deleted file mode 100644 index 2c69b63..0000000 Binary files a/resources/graphics/Zombies/ScreenDoorZombie/ScreenDoorZombieLostHeadAttack/ScreenDoorZombieLostHeadAttack_9.png and /dev/null differ diff --git a/source/component/zombie.py b/source/component/zombie.py index 1edb011..f668536 100755 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -773,4 +773,40 @@ class BucketHeadDuckyTubeZombie(Zombie): for i, name in enumerate(name_list): self.loadFrames(frame_list[i], name) + self.frames = self.helmet_walk_frames + + +class ScreenDoorZombie(Zombie): + def __init__(self, x, y, head_group): + Zombie.__init__(self, x, y, c.SCREEN_DOOR_ZOMBIE, head_group, helmetType2Health=c.SCREEN_DOOR_HEALTH) + + def loadImages(self): + self.helmet_walk_frames = [] + self.helmet_attack_frames = [] + self.walk_frames = [] + self.attack_frames = [] + self.losthead_walk_frames = [] + self.losthead_attack_frames = [] + self.die_frames = [] + self.boomdie_frames = [] + + helmet_walk_name = self.name + helmet_attack_name = self.name + 'Attack' + walk_name = c.NORMAL_ZOMBIE + attack_name = c.NORMAL_ZOMBIE + 'Attack' + losthead_walk_name = c.NORMAL_ZOMBIE + 'LostHead' + losthead_attack_name = c.NORMAL_ZOMBIE + 'LostHeadAttack' + die_name = c.NORMAL_ZOMBIE + 'Die' + boomdie_name = c.BOOMDIE + + frame_list = [self.helmet_walk_frames, self.helmet_attack_frames, + self.walk_frames, self.attack_frames, self.losthead_walk_frames, + self.losthead_attack_frames, self.die_frames, self.boomdie_frames] + name_list = [helmet_walk_name, helmet_attack_name, + walk_name, attack_name, losthead_walk_name, + losthead_attack_name, die_name, boomdie_name] + + for i, name in enumerate(name_list): + self.loadFrames(frame_list[i], name) + self.frames = self.helmet_walk_frames \ No newline at end of file diff --git a/source/constants.py b/source/constants.py index eb967c2..bc0c619 100755 --- a/source/constants.py +++ b/source/constants.py @@ -288,6 +288,7 @@ FOOTBALL_ZOMBIE = 'FootballZombie' DUCKY_TUBE_ZOMBIE = 'DuckyTubeZombie' CONEHEAD_DUCKY_TUBE_ZOMBIE = 'ConeheadDuckyTubeZombie' BUCKETHEAD_DUCKY_TUBE_ZOMBIE = 'BucketheadDuckyTubeZombie' +SCREEN_DOOR_ZOMBIE = 'ScreenDoorZombie' BOOMDIE = 'BoomDie' @@ -309,6 +310,7 @@ BUCKETHEAD_HEALTH = 1100 FOOTBALL_HELMET_HEALTH = 1400 # 有关二类防具 NEWSPAPER_HEALTH = 150 +SCREEN_DOOR_HEALTH = 1100 # 僵尸行动信息 ATTACK_INTERVAL = 500 diff --git a/source/state/level.py b/source/state/level.py index b3141f6..2afad8f 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -330,6 +330,7 @@ class Level(tool.State): c.DUCKY_TUBE_ZOMBIE:(1, 0), # 作为变种,不主动生成 c.CONEHEAD_DUCKY_TUBE_ZOMBIE:(2, 0), # 作为变种,不主动生成 c.BUCKETHEAD_DUCKY_TUBE_ZOMBIE:(4, 0), # 作为变种,不主动生成 + c.SCREEN_DOOR_ZOMBIE:(4, 3500), } # 将僵尸与水上变种对应 self.convertZombieInPool = {c.NORMAL_ZOMBIE:c.DUCKY_TUBE_ZOMBIE, @@ -685,6 +686,8 @@ class Level(tool.State): self.zombie_groups[map_y].add(zombie.ConeHeadDuckyTubeZombie(c.ZOMBIE_START_X + randint(-20, 20) + hugeWaveMove, y, self.head_group)) elif name == c.BUCKETHEAD_DUCKY_TUBE_ZOMBIE: self.zombie_groups[map_y].add(zombie.BucketHeadDuckyTubeZombie(c.ZOMBIE_START_X + randint(-20, 20) + hugeWaveMove, y, self.head_group)) + elif name == c.SCREEN_DOOR_ZOMBIE: + self.zombie_groups[map_y].add(zombie.ScreenDoorZombie(c.ZOMBIE_START_X + randint(-20, 20) + hugeWaveMove, y, self.head_group)) # 能否种植物的判断: # 先判断位置是否合法 isValid(map_x, map_y)