删除冗余设计

This commit is contained in:
星外之神 2022-05-27 11:26:28 +08:00
parent 2e4b4bdacc
commit 762741d20d
7 changed files with 34 additions and 39 deletions

View File

@ -10,6 +10,7 @@ if __name__=='__main__':
state_dict = { c.MAIN_MENU: mainmenu.Menu(), state_dict = { c.MAIN_MENU: mainmenu.Menu(),
c.GAME_VICTORY: screen.GameVictoryScreen(), c.GAME_VICTORY: screen.GameVictoryScreen(),
c.GAME_LOSE: screen.GameLoseScreen(), c.GAME_LOSE: screen.GameLoseScreen(),
c.LEVEL: level.Level()} c.LEVEL: level.Level()
}
game.setup_states(state_dict, c.MAIN_MENU) game.setup_states(state_dict, c.MAIN_MENU)
game.run() game.run()

View File

@ -6,8 +6,7 @@
"included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "NewspaperZombie", "PoleVaultingZombie"], "included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "NewspaperZombie", "PoleVaultingZombie"],
"num_flags":4, "num_flags":4,
"inevitable_zombie_list":{"20":["BucketheadZombie"]}, "inevitable_zombie_list":{"20":["BucketheadZombie"]},
"card_pool":[ "card_pool":[ "WallNutBowling",
{"name":"WallNutBowling"}, "RedWallNutBowling"
{"name":"RedWallNutBowling"}
] ]
} }

View File

@ -6,13 +6,12 @@
"num_flags":3, "num_flags":3,
"included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "PoleVaultingZombie"], "included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "PoleVaultingZombie"],
"inevitable_zombie_list":{"20":["BucketheadZombie"]}, "inevitable_zombie_list":{"20":["BucketheadZombie"]},
"card_pool":[ "card_pool":[ "Peashooter",
{"name":"Peashooter"}, "SnowPea",
{"name":"SnowPea"}, "WallNut",
{"name":"WallNut"}, "CherryBomb",
{"name":"CherryBomb"}, "RepeaterPea",
{"name":"RepeaterPea"}, "Chomper",
{"name":"Chomper"}, "PotatoMine"
{"name":"PotatoMine"}
] ]
} }

View File

@ -8,13 +8,12 @@
"BucketheadZombie", "NewspaperZombie", "BucketheadZombie", "NewspaperZombie",
"FootballZombie", "ScreenDoorZombie"], "FootballZombie", "ScreenDoorZombie"],
"inevitable_zombie_list":{"30":["FootballZombie"]}, "inevitable_zombie_list":{"30":["FootballZombie"]},
"card_pool":[ "card_pool":[ "PuffShroom",
{"name":"PuffShroom"}, "ScaredyShroom",
{"name":"ScaredyShroom"}, "IceShroom",
{"name":"IceShroom"}, "HypnoShroom",
{"name":"HypnoShroom"}, "DoomShroom",
{"name":"DoomShroom"}, "GraveBuster",
{"name":"GraveBuster"}, "FumeShroom"
{"name":"FumeShroom"}
] ]
} }

View File

@ -8,14 +8,13 @@
"BucketheadZombie", "SnorkelZombie", "BucketheadZombie", "SnorkelZombie",
"Zomboni"], "Zomboni"],
"inevitable_zombie_list":{"30":["BucketheadZombie"]}, "inevitable_zombie_list":{"30":["BucketheadZombie"]},
"card_pool":[ "card_pool":[ "Lilypad", "Lilypad",
{"name":"Lilypad"}, {"name":"Lilypad"}, "TorchWood",
{"name":"TorchWood"}, "TallNut",
{"name":"TallNut"}, "TangleKlep",
{"name":"TangleKlep"}, "Spikeweed",
{"name":"Spikeweed"}, "Squash",
{"name":"Squash"}, "Jalapeno",
{"name":"Jalapeno"}, "Threepeater", "Threepeater", "Threepeater", "Threepeater", "Threepeater"
{"name":"Threepeater"}, {"name":"Threepeater"}, {"name":"Threepeater"}, {"name":"Threepeater"}, {"name":"Threepeater"}
] ]
} }

View File

@ -148,9 +148,8 @@ def getSunValueImage(sun_value):
def getCardPool(data): def getCardPool(data):
card_pool = [] card_pool = []
for card in data: for card in data:
tmp = card['name']
for i,name in enumerate(plantInfo): for i,name in enumerate(plantInfo):
if name[c.PLANT_NAME_INDEX] == tmp: if name[c.PLANT_NAME_INDEX] == card:
card_pool.append(i) card_pool.append(i)
break break
return card_pool return card_pool

View File

@ -1393,7 +1393,6 @@ class CoffeeBean(Plant):
self.image.set_alpha(255) self.image.set_alpha(255)
class SeaShroom(Plant): class SeaShroom(Plant):
def __init__(self, x, y, bullet_group): def __init__(self, x, y, bullet_group):
Plant.__init__(self, x, y, c.SEASHROOM, c.PLANT_HEALTH, bullet_group) Plant.__init__(self, x, y, c.SEASHROOM, c.PLANT_HEALTH, bullet_group)