diff --git a/dungeonbattle/game.py b/dungeonbattle/game.py index dd2e6ef..ba61fe6 100644 --- a/dungeonbattle/game.py +++ b/dungeonbattle/game.py @@ -8,11 +8,12 @@ class Game: def init(self) -> None: Game.INSTANCE = self - self.key_handler = player_move + self.key_handler = self.player_move def new_game(self): # TODO generate a new map procedurally - m = Map.load("example_map.txt") + self.m = Map.load("example_map.txt") + self.d = MapDisplay(self.m) self.player = Player() self.player.y = 1 self.player.x = 6 @@ -26,7 +27,7 @@ class Game: while True: screen.clear() screen.refresh() - d.display(player.getPosY(), player.getPosX()) + self.d.display(self.player.getPosY(), self.player.getPosX()) key = screen.getkey() self.key_handler(key)