diff --git a/resources/data/entity/zombie.json b/resources/data/entity/zombie.json index bbc81fb..160195a 100644 --- a/resources/data/entity/zombie.json +++ b/resources/data/entity/zombie.json @@ -20,6 +20,11 @@ "NewspaperZombieNoPaperAttack":{"x":48, "width":92}, "NewspaperZombieLostHead":{"x":44, "width":96}, "NewspaperZombieLostHeadAttack":{"x":48, "width":92}, - "NewspaperZombieDie":{"x":0, "width":100} + "NewspaperZombieDie":{"x":0, "width":100}, + "DukyTubeZombie":{"x":55, "width":105}, + "DukyTubeZombieAttack":{"x":55, "width":105}, + "DukyTubeZombieDie":{"x":55, "width":105}, + "DukyTubeZombieLostHead":{"x":55, "width":105}, + "DukyTubeZombieSwim":{"x":55, "width":105} } } \ No newline at end of file diff --git a/resources/data/map/level_0.json b/resources/data/map/level_0.json index 598ad6f..140f069 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":1000, "map_y":2, "name":"FootballZombie"}, + {"time":1000, "map_y":2, "name":"DuckyTubeZombie"}, {"time":60000, "map_y":2, "name":"Zombie"} ] } \ No newline at end of file diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_0.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_0.png new file mode 100644 index 0000000..4abf48c Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_0.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_1.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_1.png new file mode 100644 index 0000000..2982329 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_1.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_10.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_10.png new file mode 100644 index 0000000..5af632f Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_10.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_11.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_11.png new file mode 100644 index 0000000..39e036f Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_11.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_12.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_12.png new file mode 100644 index 0000000..295ce58 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_12.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_13.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_13.png new file mode 100644 index 0000000..295ce58 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_13.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_14.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_14.png new file mode 100644 index 0000000..ef68634 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_14.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_15.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_15.png new file mode 100644 index 0000000..fef0b70 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_15.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_16.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_16.png new file mode 100644 index 0000000..c52d328 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_16.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_2.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_2.png new file mode 100644 index 0000000..01649ad Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_2.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_3.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_3.png new file mode 100644 index 0000000..a41fc34 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_3.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_4.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_4.png new file mode 100644 index 0000000..2904f07 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_4.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_5.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_5.png new file mode 100644 index 0000000..1b0f155 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_5.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_6.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_6.png new file mode 100644 index 0000000..4278132 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_6.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_7.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_7.png new file mode 100644 index 0000000..88d3496 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_7.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_8.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_8.png new file mode 100644 index 0000000..dd98b83 Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_8.png differ diff --git a/resources/graphics/Plants/CoffeeBean/CoffeeBean_9.png b/resources/graphics/Plants/CoffeeBean/CoffeeBean_9.png new file mode 100644 index 0000000..fece09c Binary files /dev/null and b/resources/graphics/Plants/CoffeeBean/CoffeeBean_9.png differ diff --git a/source/component/zombie.py b/source/component/zombie.py index bdd8511..9e87151 100755 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -4,7 +4,7 @@ from .. import constants as c class Zombie(pg.sprite.Sprite): - def __init__(self, x, y, name, head_group=None, helmetHealth=0, helmetType2Health=0, bodyHealth=c.NORMAL_HEALTH + c.LOSTHEAD_HEALTH, damage=c.ZOMBIE_ATTACK_DAMAGE): + def __init__(self, x, y, name, head_group=None, helmetHealth=0, helmetType2Health=0, bodyHealth=c.NORMAL_HEALTH + c.LOSTHEAD_HEALTH, damage=c.ZOMBIE_ATTACK_DAMAGE, canSwim=False): pg.sprite.Sprite.__init__(self) self.name = name @@ -574,4 +574,35 @@ class FootballZombie(Zombie): 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 + self.frames = self.helmet_walk_frames + +class DuckyTubeZombie(Zombie): + def __init__(self, x, y, head_group): + Zombie.__init__(self, x, y, c.DUCKY_TUBE_ZOMBIE, head_group, canSwim=True) + + def loadImages(self): + self.walk_frames = [] + self.swim_frames = [] + self.attack_frames = [] + self.losthead_walk_frames = [] + self.losthead_attack_frames = [] + self.die_frames = [] + self.boomdie_frames = [] + + walk_name = self.name + swim_name = self.name + 'Swim' + attack_name = self.name + 'Attack' + losthead_walk_name = self.name + 'LostHead' + losthead_attack_name = self.name + 'LostHead' + die_name = self.name + 'Die' + boomdie_name = c.BOOMDIE + + frame_list = [self.walk_frames, self.swim_frames, self.attack_frames, self.losthead_walk_frames, + self.losthead_attack_frames, self.die_frames, self.boomdie_frames] + name_list = [walk_name, swim_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.walk_frames diff --git a/source/constants.py b/source/constants.py index ed20440..adc1f82 100755 --- a/source/constants.py +++ b/source/constants.py @@ -141,6 +141,9 @@ MAP_POOL_OFFSET_Y = 115 MAP_ROOF_OFFSET_X = 35 # 暂时还不清楚数据 MAP_ROOF_OFFSET_Y = 105 # 暂时还不清楚数据 +# 泳池前端陆地部分 +MAP_POOL_FRONT_X = 770 + # 植物选择菜单栏、传送带菜单栏等类型设定 CHOOSEBAR_TYPE = 'choosebar_type' CHOOSEBAR_STATIC = 0 @@ -277,6 +280,8 @@ BUCKETHEAD_ZOMBIE = 'BucketheadZombie' FLAG_ZOMBIE = 'FlagZombie' NEWSPAPER_ZOMBIE = 'NewspaperZombie' FOOTBALL_ZOMBIE = 'FootballZombie' +DUCKY_TUBE_ZOMBIE = 'DuckyTubeZombie' + BOOMDIE = 'BoomDie' # 对僵尸的攻击类型设置 diff --git a/source/state/level.py b/source/state/level.py index 403ccdf..96f6a39 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -657,6 +657,8 @@ class Level(tool.State): self.zombie_groups[map_y].add(zombie.NewspaperZombie(c.ZOMBIE_START_X + randint(-20, 20) + hugeWaveMove, y, self.head_group)) elif name == c.FOOTBALL_ZOMBIE: self.zombie_groups[map_y].add(zombie.FootballZombie(c.ZOMBIE_START_X + randint(-20, 20) + hugeWaveMove, y, self.head_group)) + elif name == c.DUCKY_TUBE_ZOMBIE: + self.zombie_groups[map_y].add(zombie.DuckyTubeZombie(c.ZOMBIE_START_X + randint(-20, 20) + hugeWaveMove, y, self.head_group)) # 能否种植物的判断: # 先判断位置是否合法 isValid(map_x, map_y)