删除冗余设计
This commit is contained in:
parent
2e4b4bdacc
commit
762741d20d
9
main.py
9
main.py
@ -7,9 +7,10 @@ from source.state import mainmenu, screen, level
|
|||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
# 控制状态机运行
|
# 控制状态机运行
|
||||||
game = tool.Control()
|
game = tool.Control()
|
||||||
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()
|
||||||
|
|||||||
@ -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"}
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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"}
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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"}
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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"}
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user