修复变量名错误
This commit is contained in:
parent
8d06608e14
commit
54e40df6c4
@ -162,7 +162,7 @@ MAP_UNAVAILABLE = 'unavailable' # 指完全不能种植物的地方,包括无
|
|||||||
# 不喜欢用深拷贝,直接改用函数表示,需要时直接调用该函数生成即可
|
# 不喜欢用深拷贝,直接改用函数表示,需要时直接调用该函数生成即可
|
||||||
# 由于同一格显然不可能种两个相同的植物,所以用集合
|
# 由于同一格显然不可能种两个相同的植物,所以用集合
|
||||||
def INIT_MAP_GRID(PLOT_TYPE):
|
def INIT_MAP_GRID(PLOT_TYPE):
|
||||||
return {MAP_PLANT:set(), MAP_SLEEP:False, MAP_PLOT_TYPE:POLT_TYPE}
|
return {MAP_PLANT:set(), MAP_SLEEP:False, MAP_PLOT_TYPE:PLOT_TYPE}
|
||||||
|
|
||||||
# 地图相关像素数据
|
# 地图相关像素数据
|
||||||
BACKGROUND_OFFSET_X = 220
|
BACKGROUND_OFFSET_X = 220
|
||||||
|
|||||||
@ -189,16 +189,14 @@ def load_all_gfx(directory, colorkey=c.WHITE, accept=('.png', '.jpg', '.bmp', '.
|
|||||||
# 用于消除文件边框影响
|
# 用于消除文件边框影响
|
||||||
def loadZombieImageRect():
|
def loadZombieImageRect():
|
||||||
file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'resources', 'data', 'entity', 'zombie.json')
|
file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'resources', 'data', 'entity', 'zombie.json')
|
||||||
f = open(file_path)
|
with open(file_path) as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
f.close()
|
|
||||||
return data[c.ZOMBIE_IMAGE_RECT]
|
return data[c.ZOMBIE_IMAGE_RECT]
|
||||||
|
|
||||||
def loadPlantImageRect():
|
def loadPlantImageRect():
|
||||||
file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'resources', 'data', 'entity', 'plant.json')
|
file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'resources', 'data', 'entity', 'plant.json')
|
||||||
f = open(file_path)
|
with open(file_path) as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
f.close()
|
|
||||||
return data[c.PLANT_IMAGE_RECT]
|
return data[c.PLANT_IMAGE_RECT]
|
||||||
|
|
||||||
pg.init()
|
pg.init()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user