加入冰车僵尸

This commit is contained in:
星外之神 2022-05-14 13:03:30 +08:00
parent 5bb62383c5
commit afe3a03d44
22 changed files with 23 additions and 14 deletions

View File

@ -5,7 +5,7 @@
**本项目为个人python语言学习的练习项目仅供个人学习和研究使用不得用于其他用途。如果这个游戏侵犯了版权请联系我删除** **本项目为个人python语言学习的练习项目仅供个人学习和研究使用不得用于其他用途。如果这个游戏侵犯了版权请联系我删除**
* 已有的植物:向日葵,豌豆射手,坚果墙,寒冰射手,樱桃炸弹,双发射手,三线射手,大嘴花,小喷菇,土豆雷,地刺,胆小菇,倭瓜,火爆辣椒,阳光菇,寒冰菇,魅惑菇,火炬树桩,睡莲,杨桃,咖啡豆,海蘑菇,高坚果,缠绕水草,毁灭菇,墓碑吞噬者,大喷菇 * 已有的植物:向日葵,豌豆射手,坚果墙,寒冰射手,樱桃炸弹,双发射手,三线射手,大嘴花,小喷菇,土豆雷,地刺,胆小菇,倭瓜,火爆辣椒,阳光菇,寒冰菇,魅惑菇,火炬树桩,睡莲,杨桃,咖啡豆,海蘑菇,高坚果,缠绕水草,毁灭菇,墓碑吞噬者,大喷菇
* 已有的僵尸:普通僵尸,旗帜僵尸,路障僵尸,铁桶僵尸,读报僵尸,橄榄球僵尸,鸭子救生圈僵尸,铁门僵尸,撑杆跳僵尸 * 已有的僵尸:普通僵尸,旗帜僵尸,路障僵尸,铁桶僵尸,读报僵尸,橄榄球僵尸,鸭子救生圈僵尸,铁门僵尸,撑杆跳僵尸,冰车僵尸
* 使用 JSON 文件记录关卡信息数据 * 使用 JSON 文件记录关卡信息数据
* 支持选择植物卡片 * 支持选择植物卡片
* 支持白昼模式,夜晚模式,泳池模式,传送带模式和坚果保龄球模式 * 支持白昼模式,夜晚模式,泳池模式,传送带模式和坚果保龄球模式
@ -48,8 +48,8 @@ python main.py
* 冒险模式: * 冒险模式:
* 1和2白昼模式 * 1和2白昼模式
* 3夜晚模式 * 3夜晚模式
* 4泳池模式 * 4和5:泳池模式
* 5: 浓雾模式(暂时没有雾) * 6: 浓雾模式(暂时没有雾)
* 小游戏模式: * 小游戏模式:
* 1传送带模式 * 1传送带模式
* 2坚果保龄球模式 * 2坚果保龄球模式

View File

@ -1,9 +1,9 @@
{ {
"background_type":3, "background_type":2,
"init_sun_value":50, "init_sun_value":50,
"shovel":1, "shovel":1,
"spawn_zombies":"auto", "spawn_zombies":"auto",
"included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "FootballZombie"], "included_zombies":["Zombie", "Zomboni"],
"inevitable_zombie_list":{"20":["BucketheadZombie"], "30":["FootballZombie"]}, "inevitable_zombie_list":{"30":["Zomboni"]},
"num_flags":4 "num_flags":3
} }

View File

@ -0,0 +1,9 @@
{
"background_type":3,
"init_sun_value":50,
"shovel":1,
"spawn_zombies":"auto",
"included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "FootballZombie"],
"inevitable_zombie_list":{"20":["BucketheadZombie"], "30":["FootballZombie"]},
"num_flags":4
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -939,6 +939,8 @@ class Zomboni(Zombie):
self.plant_group = plant_group self.plant_group = plant_group
self.map = map self.map = map
self.IceFrozenPlot = IceFrozenPlot self.IceFrozenPlot = IceFrozenPlot
self.die_animate_interval = 100
self.boomDie_animate_interval = 150
def loadImages(self): def loadImages(self):
self.walk_frames = [] self.walk_frames = []
@ -1000,12 +1002,9 @@ class Zomboni(Zombie):
plant.setDamage(8000, self) plant.setDamage(8000, self)
# 造冰 # 造冰
mapX, mapY = self.map.getMapIndex(self.rect.right, self.rect.bottom) mapX, mapY = self.map.getMapIndex(self.rect.right - 20, self.rect.bottom)
if 0 <= mapX < c.GRID_X_LEN: if 0 <= mapX < c.GRID_X_LEN:
if c.ICE_FROZEN_PLOT not in self.map.map[mapY][mapX]: if c.ICE_FROZEN_PLOT not in self.map.map[mapY][mapX]:
x, y = self.map.getMapGridPos(mapX, mapY) x, y = self.map.getMapGridPos(mapX, mapY)
self.plant_group.add(self.IceFrozenPlot(x, y)) self.plant_group.add(self.IceFrozenPlot(x, y))
self.map.map[mapY][mapX][c.MAP_PLANT].add(c.ICE_FROZEN_PLOT)
def handleState(self):
self.walking()

View File

@ -434,6 +434,7 @@ class Level(tool.State):
c.BUCKETHEAD_DUCKY_TUBE_ZOMBIE:(4, 0), # 作为变种,不主动生成 c.BUCKETHEAD_DUCKY_TUBE_ZOMBIE:(4, 0), # 作为变种,不主动生成
c.SCREEN_DOOR_ZOMBIE:(4, 3500), c.SCREEN_DOOR_ZOMBIE:(4, 3500),
c.POLE_VAULTING_ZOMBIE:(2, 2000), c.POLE_VAULTING_ZOMBIE:(2, 2000),
c.ZOMBONI:(7, 2000),
} }
# 将僵尸与水上变种对应 # 将僵尸与水上变种对应
self.convertZombieInPool = {c.NORMAL_ZOMBIE:c.DUCKY_TUBE_ZOMBIE, self.convertZombieInPool = {c.NORMAL_ZOMBIE:c.DUCKY_TUBE_ZOMBIE,
@ -839,7 +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)) self.zombie_groups[map_y].add(zombie.PoleVaultingZombie(c.ZOMBIE_START_X + randint(70, 80) + hugeWaveMove, y, self.head_group))
elif name == c.ZOMBONI: elif name == c.ZOMBONI:
self.zombie_groups[map_y].add(zombie.Zomboni(c.ZOMBIE_START_X + randint(0, 20) + hugeWaveMove, y, self.plant_groups[map_y], self.map, plant.IceFrozenPlot)) 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))
# 能否种植物的判断: # 能否种植物的判断:
# 先判断位置是否合法 isValid(map_x, map_y) # 先判断位置是否合法 isValid(map_x, map_y)