From 6de8fc10fbe5d010eb1f682667b725e7ed3b0147 Mon Sep 17 00:00:00 2001 From: wszqkzqk Date: Sun, 25 Dec 2022 20:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E9=9D=A2=E5=90=91=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/map.py | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/source/component/map.py b/source/component/map.py index efb8e73..0984329 100755 --- a/source/component/map.py +++ b/source/component/map.py @@ -200,6 +200,39 @@ class Map(): return pos +class MapData(): + def __init__( self, + bg_type:int, + included_zombies:tuple[str], + game_title:str, + flags:int, + init_sun:int = 50, + has_shovel:bool = True, + ) -> None: + self.is_classic = False + self.bg_type = bg_type + self.included_zombies = included_zombies + self.game_title = game_title + self.flags = flags + self.init_sun = init_sun + self.has_shovel = has_shovel + + @classmethod + def classic( self, + bg_type:int, + zombie_list:tuple[dict], + game_title:str, + flags:int, + init_sun:int = 50, + has_shovel:bool = True, + ) -> None: + self.is_classic = True + self.bg_type = bg_type + self.zombie_list = zombie_list + self.game_title = game_title + self.flags = flags + self.init_sun = init_sun + self.has_shovel = has_shovel # 保存具体关卡地图信息常数 # 冒险模式地图 @@ -211,7 +244,7 @@ LEVEL_MAP_DATA = ( c.INIT_SUN_NAME: 5000, c.SHOVEL: 1, c.SPAWN_ZOMBIES: c.SPAWN_ZOMBIES_LIST, - c.ZOMBIE_LIST:[ + c.ZOMBIE_LIST:( {"time":0, "map_y":5, "name":"Zomboni"}, {"time":1000, "map_y":4, "name":"ScreenDoorZombie"}, {"time":2000, "map_y":4, "name":"ScreenDoorZombie"}, @@ -227,7 +260,7 @@ LEVEL_MAP_DATA = ( {"time":0, "map_y":3, "name":"ConeheadDuckyTubeZombie"}, {"time":0, "map_y":2, "name":"SnorkelZombie"}, {"time":90000, "map_y":2, "name":"ConeheadDuckyTubeZombie"} - ] + ) }, # 第1关:单行草皮 {