diff --git a/source/component/map.py b/source/component/map.py index 33df184..544b830 100755 --- a/source/component/map.py +++ b/source/component/map.py @@ -89,7 +89,7 @@ class Map(): if self.background_type in {c.BACKGROUND_POOL, c.BACKGROUND_FOG}: x -= c.MAP_POOL_OFFSET_X y -= c.MAP_POOL_OFFSET_Y - return (x // c.GIRD_POOL_X_SIZE, y // c.GRID_POOL_Y_SIZE) + return (x // c.GRID_POOL_X_SIZE, y // c.GRID_POOL_Y_SIZE) elif self.background_type in {c.BACKGROUND_ROOF, c.BACKGROUND_ROOFNIGHT}: x -= c.MAP_ROOF_OFFSET_X y -= c.MAP_ROOF_OFFSET_X @@ -106,11 +106,11 @@ class Map(): def getMapGridPos(self, map_x, map_y): if self.background_type in {c.BACKGROUND_POOL, c.BACKGROUND_FOG}: - return (map_x * c.GRID_ROOF_X_SIZE + c.GRID_X_SIZE//2 + c.MAP_ROOF_OFFSET_X, - map_y * c.GRID_ROOF_Y_SIZE + c.GRID_Y_SIZE//5 * 3 + c.MAP_ROOF_OFFSET_Y) + return (map_x * c.GRID_POOL_X_SIZE + c.GRID_POOL_X_SIZE//2 + c.MAP_POOL_OFFSET_X, + map_y * c.GRID_POOL_Y_SIZE + c.GRID_POOL_Y_SIZE//5 * 3 + c.MAP_POOL_OFFSET_Y) elif self.background_type in {c.BACKGROUND_ROOF, c.BACKGROUND_ROOFNIGHT}: - return (map_x * c.GRID_POOL_X_SIZE + c.GRID_X_SIZE//2 + c.MAP_POOL_OFFSET_X, - map_y * c.GRID_POOL_Y_SIZE + 20 * max(0, (6 - map_y)) + c.GRID_Y_SIZE//5 * 3 + c.MAP_POOL_OFFSET_Y) + return (map_x * c.GRID_ROOF_X_SIZE + c.GRID_ROOF_X_SIZE//2 + c.MAP_ROOF_OFFSET_X, + map_y * c.GRID_ROOF_Y_SIZE + 20 * max(0, (6 - map_y)) + c.GRID_ROOF_Y_SIZE//5 * 3 + c.MAP_POOL_OFFSET_Y) else: 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) diff --git a/source/constants.py b/source/constants.py index f66144c..3c53f70 100755 --- a/source/constants.py +++ b/source/constants.py @@ -19,7 +19,7 @@ GRID_Y_SIZE = 100 # 带有泳池 GRID_POOL_X_LEN = GRID_X_LEN GRID_POOL_Y_LEN = 6 -GIRD_POOL_X_SIZE = GRID_X_SIZE +GRID_POOL_X_SIZE = GRID_X_SIZE GRID_POOL_Y_SIZE = 85 # 屋顶 GRID_ROOF_X_LEN = GRID_X_LEN @@ -106,7 +106,7 @@ MAP_STATE_TILE = {MAP_PLANT:set(), MAP_SLEEP:False, MAP_PLOT_TYPE:MAP_TILE} BACKGROUND_OFFSET_X = 220 MAP_OFFSET_X = 35 MAP_OFFSET_Y = 100 -MAP_POOL_OFFSET_X = 35 # 暂时还不清楚数据 +MAP_POOL_OFFSET_X = 42 # 暂时还不清楚数据 MAP_POOL_OFFSET_Y = 115 # 暂时还不清楚数据 MAP_ROOF_OFFSET_X = 35 # 暂时还不清楚数据 MAP_ROOF_OFFSET_Y = 105 # 暂时还不清楚数据