Corrigé la merde de Charles
This commit is contained in:
parent
37c9fd5267
commit
bbbcb1b10e
|
@ -8,11 +8,12 @@ class Game:
|
||||||
|
|
||||||
def init(self) -> None:
|
def init(self) -> None:
|
||||||
Game.INSTANCE = self
|
Game.INSTANCE = self
|
||||||
self.key_handler = player_move
|
self.key_handler = self.player_move
|
||||||
|
|
||||||
def new_game(self):
|
def new_game(self):
|
||||||
# TODO generate a new map procedurally
|
# 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 = Player()
|
||||||
self.player.y = 1
|
self.player.y = 1
|
||||||
self.player.x = 6
|
self.player.x = 6
|
||||||
|
@ -26,7 +27,7 @@ class Game:
|
||||||
while True:
|
while True:
|
||||||
screen.clear()
|
screen.clear()
|
||||||
screen.refresh()
|
screen.refresh()
|
||||||
d.display(player.getPosY(), player.getPosX())
|
self.d.display(self.player.getPosY(), self.player.getPosX())
|
||||||
key = screen.getkey()
|
key = screen.getkey()
|
||||||
self.key_handler(key)
|
self.key_handler(key)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue