25 lines
482 B
Python
25 lines
482 B
Python
from dusk.event import Event
|
|
|
|
MAP_WIDTH = 5
|
|
MAP_HEIGHT = 5
|
|
MAP_DEPTH = 3
|
|
|
|
class Map:
|
|
def __init__(self):
|
|
self.position = [0, 0, 0] # x, y, z
|
|
self.positionEvent = Event()
|
|
self.chunks = []
|
|
|
|
def moveTo(self, x, y, z):
|
|
self.position = [x, y, z]
|
|
self.positionEvent.invoke(self.position)
|
|
|
|
def moveRelative(self, x, y, z):
|
|
self.moveTo(
|
|
self.position[0] + x,
|
|
self.position[1] + y,
|
|
self.position[2] + z
|
|
)
|
|
|
|
# Singleton instance
|
|
map = Map() |