AI-Project/survival/game_map.py

21 lines
560 B
Python
Raw Normal View History

2021-03-04 15:02:42 +01:00
from survival.player import Player
2021-03-14 17:12:11 +01:00
from survival.tile_layer import TileLayer
2021-03-04 14:07:44 +01:00
class GameMap:
def __init__(self, width, height):
self.width = width
self.height = height
self.player = Player()
self.layers = []
self.layers.append(TileLayer(width, height))
2021-03-04 14:07:44 +01:00
def draw(self, camera):
for layer in self.layers:
layer.draw(camera)
self.player.draw(camera)
2021-03-04 14:07:44 +01:00
def update(self, camera, delta, pressed_keys):
self.player.update(delta, pressed_keys)
camera.update(self.player)