Collisions are working

This commit is contained in:
Yohann D'ANELLO
2020-11-06 18:03:30 +01:00
parent 54bb2d1416
commit d06a42469a
2 changed files with 24 additions and 8 deletions

View File

@ -5,14 +5,14 @@ class Player(FightingEntity):
maxhealth = 20
strength = 5
def move_up(self) -> None:
self.check_move(self.y - 1, self.x, True)
def move_up(self) -> bool:
return self.check_move(self.y - 1, self.x, True)
def move_down(self) -> None:
self.check_move(self.y + 1, self.x, True)
def move_down(self) -> bool:
return self.check_move(self.y + 1, self.x, True)
def move_left(self) -> None:
self.check_move(self.y, self.x - 1, True)
def move_left(self) -> bool:
return self.check_move(self.y, self.x - 1, True)
def move_right(self) -> None:
self.check_move(self.y, self.x + 1, True)
def move_right(self) -> bool:
return self.check_move(self.y, self.x + 1, True)