diff --git a/Map.py b/Map.py new file mode 100644 index 0000000..fa28f0d --- /dev/null +++ b/Map.py @@ -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