删除冗余设计

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

@ -7,9 +7,10 @@ from source.state import mainmenu, screen, level
if __name__=='__main__':
# 控制状态机运行
game = tool.Control()
state_dict = {c.MAIN_MENU: mainmenu.Menu(),
state_dict = { c.MAIN_MENU: mainmenu.Menu(),
c.GAME_VICTORY: screen.GameVictoryScreen(),
c.GAME_LOSE: screen.GameLoseScreen(),
c.LEVEL: level.Level()}
c.LEVEL: level.Level()
}
game.setup_states(state_dict, c.MAIN_MENU)
game.run()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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