From 3bcd43137add8d47c1c0acccfc137f076252972a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Fri, 22 Apr 2022 16:05:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=B8=A6=E6=9D=A5=E7=9A=84=E7=AC=91=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/map.py | 10 +++++----- source/constants.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) 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 # 暂时还不清楚数据