加入冰车僵尸
@ -5,7 +5,7 @@
|
||||
**本项目为个人python语言学习的练习项目,仅供个人学习和研究使用,不得用于其他用途。如果这个游戏侵犯了版权,请联系我删除**
|
||||
|
||||
* 已有的植物:向日葵,豌豆射手,坚果墙,寒冰射手,樱桃炸弹,双发射手,三线射手,大嘴花,小喷菇,土豆雷,地刺,胆小菇,倭瓜,火爆辣椒,阳光菇,寒冰菇,魅惑菇,火炬树桩,睡莲,杨桃,咖啡豆,海蘑菇,高坚果,缠绕水草,毁灭菇,墓碑吞噬者,大喷菇
|
||||
* 已有的僵尸:普通僵尸,旗帜僵尸,路障僵尸,铁桶僵尸,读报僵尸,橄榄球僵尸,鸭子救生圈僵尸,铁门僵尸,撑杆跳僵尸
|
||||
* 已有的僵尸:普通僵尸,旗帜僵尸,路障僵尸,铁桶僵尸,读报僵尸,橄榄球僵尸,鸭子救生圈僵尸,铁门僵尸,撑杆跳僵尸,冰车僵尸
|
||||
* 使用 JSON 文件记录关卡信息数据
|
||||
* 支持选择植物卡片
|
||||
* 支持白昼模式,夜晚模式,泳池模式,传送带模式和坚果保龄球模式
|
||||
@ -48,8 +48,8 @@ python main.py
|
||||
* 冒险模式:
|
||||
* 1和2:白昼模式
|
||||
* 3:夜晚模式
|
||||
* 4:泳池模式
|
||||
* 5: 浓雾模式(暂时没有雾)
|
||||
* 4和5:泳池模式
|
||||
* 6: 浓雾模式(暂时没有雾)
|
||||
* 小游戏模式:
|
||||
* 1:传送带模式
|
||||
* 2:坚果保龄球模式
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
{
|
||||
"background_type":3,
|
||||
"background_type":2,
|
||||
"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
|
||||
"included_zombies":["Zombie", "Zomboni"],
|
||||
"inevitable_zombie_list":{"30":["Zomboni"]},
|
||||
"num_flags":3
|
||||
}
|
||||
|
||||
9
resources/data/map/level_6.json
Normal 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
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 6.0 KiB |
@ -939,6 +939,8 @@ class Zomboni(Zombie):
|
||||
self.plant_group = plant_group
|
||||
self.map = map
|
||||
self.IceFrozenPlot = IceFrozenPlot
|
||||
self.die_animate_interval = 100
|
||||
self.boomDie_animate_interval = 150
|
||||
|
||||
def loadImages(self):
|
||||
self.walk_frames = []
|
||||
@ -1000,12 +1002,9 @@ class Zomboni(Zombie):
|
||||
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 c.ICE_FROZEN_PLOT not in self.map.map[mapY][mapX]:
|
||||
x, y = self.map.getMapGridPos(mapX, mapY)
|
||||
self.plant_group.add(self.IceFrozenPlot(x, y))
|
||||
|
||||
|
||||
def handleState(self):
|
||||
self.walking()
|
||||
self.map.map[mapY][mapX][c.MAP_PLANT].add(c.ICE_FROZEN_PLOT)
|
||||
|
||||
@ -434,6 +434,7 @@ class Level(tool.State):
|
||||
c.BUCKETHEAD_DUCKY_TUBE_ZOMBIE:(4, 0), # 作为变种,不主动生成
|
||||
c.SCREEN_DOOR_ZOMBIE:(4, 3500),
|
||||
c.POLE_VAULTING_ZOMBIE:(2, 2000),
|
||||
c.ZOMBONI:(7, 2000),
|
||||
}
|
||||
# 将僵尸与水上变种对应
|
||||
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))
|
||||
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)
|
||||
|
||||