更改卡片间距
This commit is contained in:
parent
124ccc0e15
commit
bb6f9a8b10
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 23 KiB |
@ -9,7 +9,7 @@ class Map():
|
|||||||
self.height = height
|
self.height = height
|
||||||
# 要把记录信息改成元组的话这里又得改
|
# 要把记录信息改成元组的话这里又得改
|
||||||
# 而且不同场地还不一样
|
# 而且不同场地还不一样
|
||||||
self.map = [[0 for x in range(self.width)] for y in range(self.height)]
|
self.map = [[c.MAP_EMPTY for x in range(self.width)] for y in range(self.height)]
|
||||||
|
|
||||||
def isValid(self, map_x, map_y):
|
def isValid(self, map_x, map_y):
|
||||||
if (map_x < 0 or map_x >= self.width or
|
if (map_x < 0 or map_x >= self.width or
|
||||||
@ -21,13 +21,14 @@ class Map():
|
|||||||
def isMovable(self, map_x, map_y):
|
def isMovable(self, map_x, map_y):
|
||||||
# 目前没有南瓜头,所以用是否为空判断
|
# 目前没有南瓜头,所以用是否为空判断
|
||||||
# 可将南瓜头新定义一个状态(如:2),基于此进一步判断
|
# 可将南瓜头新定义一个状态(如:2),基于此进一步判断
|
||||||
# 应当改成元组,保存南瓜头、花盆、睡莲等状态
|
# 应当改成元组,保存南瓜头、花盆、睡莲等状态(字典也可,还更方便)
|
||||||
# 当然,不用元组的话字符串也行,但是得把判断植物写在母函数中,并且需要更多参数
|
# 当然,不用元组的话字符串也行,但是得把判断植物写在母函数中,并且需要更多参数
|
||||||
# 这样返回的就是一个具体信息,而非bool值了
|
# 这样返回的就是一个具体信息,而非bool值了
|
||||||
# 到时候还要改一下变量名,还叫isMovable不合适
|
# 到时候还要改一下变量名,还叫isMovable不合适
|
||||||
return (self.map[map_y][map_x] == c.MAP_EMPTY)
|
return (self.map[map_y][map_x] == c.MAP_EMPTY)
|
||||||
|
|
||||||
def getMapIndex(self, x, y):
|
def getMapIndex(self, x, y):
|
||||||
|
# 引入新地图后需要增加这里的内容
|
||||||
x -= c.MAP_OFFSET_X
|
x -= c.MAP_OFFSET_X
|
||||||
y -= c.MAP_OFFSET_Y
|
y -= c.MAP_OFFSET_Y
|
||||||
return (x // c.GRID_X_SIZE, y // c.GRID_Y_SIZE)
|
return (x // c.GRID_X_SIZE, y // c.GRID_Y_SIZE)
|
||||||
|
|||||||
@ -6,7 +6,7 @@ from .. import constants as c
|
|||||||
|
|
||||||
PANEL_Y_START = 87
|
PANEL_Y_START = 87
|
||||||
PANEL_X_START = 22
|
PANEL_X_START = 22
|
||||||
PANEL_Y_INTERNAL = 74
|
PANEL_Y_INTERNAL = 67
|
||||||
PANEL_X_INTERNAL = 53
|
PANEL_X_INTERNAL = 53
|
||||||
# 以后可以增加到10,并且增加解锁功能
|
# 以后可以增加到10,并且增加解锁功能
|
||||||
CARD_LIST_NUM = 8
|
CARD_LIST_NUM = 8
|
||||||
|
|||||||
@ -16,6 +16,7 @@ class Level(tool.State):
|
|||||||
self.persist = self.game_info
|
self.persist = self.game_info
|
||||||
self.game_info[c.CURRENT_TIME] = current_time
|
self.game_info[c.CURRENT_TIME] = current_time
|
||||||
self.map_y_len = c.GRID_Y_LEN
|
self.map_y_len = c.GRID_Y_LEN
|
||||||
|
# 可以给map加一个地图类型参数
|
||||||
self.map = map.Map(c.GRID_X_LEN, self.map_y_len)
|
self.map = map.Map(c.GRID_X_LEN, self.map_y_len)
|
||||||
|
|
||||||
# 暂停状态
|
# 暂停状态
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user