parent
19f310355b
commit
c3888b79af
@ -0,0 +1,16 @@
|
|||||||
|
# Map.py
|
||||||
|
import pygame
|
||||||
|
from Constant import IMAGE_PATH
|
||||||
|
|
||||||
|
|
||||||
|
# 创建地图类
|
||||||
|
class Map:
|
||||||
|
# 存储两张不同颜色的图片名称
|
||||||
|
map_names_list = [IMAGE_PATH + "map1.png", IMAGE_PATH + "map2.png"]
|
||||||
|
|
||||||
|
# 初始化地图
|
||||||
|
def __init__(self, x, y, img_index):
|
||||||
|
self.image = pygame.image.load(Map.map_names_list[img_index])
|
||||||
|
self.position = (x, y)
|
||||||
|
# 是否能够种植
|
||||||
|
self.can_grow = True
|
Loading…
Reference in new issue