-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaps.py
More file actions
23 lines (17 loc) · 782 Bytes
/
maps.py
File metadata and controls
23 lines (17 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import matrix
import tiles
from settings import *
class Map:
m = None # Represents currently selected map
manager = {} # Keeps track of all maps
def __init__(self, gridSize, name, tileSize=[32, 32], margin=[50, 50], fill=COLORS["BLACK"]):
self.gridSize = gridSize # You can't change this without destroying everything
self.tileSize = tileSize # Can change, this represents default, you will need to rescale textures
self.margin = margin # Can change, this represents default
self.name = name
self.grid = matrix.Grid(self.gridSize, fill=tiles.Tile(fill))
Map.manager[self.name] = self
Map.m = self
def load(self, mapname):
Map.manager[Map.m.name] = Map.m
Map.m = Map.manager[mapname]