diff --git a/source/component/map.py b/source/component/map.py index ec31160..d2e1d52 100755 --- a/source/component/map.py +++ b/source/component/map.py @@ -115,8 +115,8 @@ class Map(): return (map_x * c.GRID_X_SIZE + c.GRID_X_SIZE//2 + c.MAP_OFFSET_X, map_y * c.GRID_Y_SIZE + c.GRID_Y_SIZE//5 * 3 + c.MAP_OFFSET_Y) - def setMapGridType(self, map_x, map_y, type): - self.map[map_y][map_x] = type + def setMapGridType(self, map_x, map_y, plot_type): + self.map[map_y][map_x] = plot_type def addMapPlant(self, map_x, map_y, plantName, sleep=False): self.map[map_y][map_x][c.MAP_PLANT].add(plantName) diff --git a/source/constants.py b/source/constants.py index abc6ca2..c0da0a7 100755 --- a/source/constants.py +++ b/source/constants.py @@ -105,10 +105,11 @@ MAP_PLOT_TYPE = 'plotType' MAP_GRASS = 'grass' MAP_WATER = 'water' MAP_TILE = 'tile' # 指屋顶上的瓦片 -MAP_DAMAGED = 'damaged' +MAP_UNAVAILABLE = 'unavailable' # 指完全不能种植物的地方,包括无草皮的荒地、毁灭菇坑、冰车留下的冰 MAP_STATE_EMPTY = {MAP_PLANT:set(), MAP_SLEEP:False, MAP_PLOT_TYPE:MAP_GRASS} # 由于同一格显然不可能种两个相同的植物,所以用集合 MAP_STATE_WATER = {MAP_PLANT:set(), MAP_SLEEP:False, MAP_PLOT_TYPE:MAP_WATER} MAP_STATE_TILE = {MAP_PLANT:set(), MAP_SLEEP:False, MAP_PLOT_TYPE:MAP_TILE} +MAP_STATE_UNAVAILABLE = {MAP_PLANT:set(), MAP_SLEEP:False, MAP_PLOT_TYPE:MAP_UNAVAILABLE} # 地图相关像素数据 BACKGROUND_OFFSET_X = 220 diff --git a/source/state/level.py b/source/state/level.py index 266e3e8..b94f360 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -145,7 +145,7 @@ class Level(tool.State): print('initBowlingMap') for x in range(3, self.map.width): for y in range(self.map.height): - self.map.setMapGridType(x, y, c.MAP_STATE_TILE) # 将坚果保龄球红线右侧视为屋顶的瓦片以达到不能直接种植植物的效果 + self.map.setMapGridType(x, y, c.MAP_STATE_UNAVAILABLE) # 将坚果保龄球红线右侧设置为不可种植任何植物 def initState(self): # 小游戏才有CHOOSEBAR_TYPE