squirrel-battle/dungeonbattle/entities/player.py

19 lines
443 B
Python
Raw Normal View History

from ..interfaces import FightingEntity
2020-11-06 14:33:26 +00:00
class Player(FightingEntity):
maxhealth = 20
strength = 5
def move_up(self) -> None:
2020-11-06 16:59:19 +00:00
self.check_move(self.y - 1, self.x, True)
def move_down(self) -> None:
2020-11-06 16:59:19 +00:00
self.check_move(self.y + 1, self.x, True)
def move_left(self) -> None:
2020-11-06 16:59:19 +00:00
self.check_move(self.y, self.x - 1, True)
def move_right(self) -> None:
2020-11-06 16:59:19 +00:00
self.check_move(self.y, self.x + 1, True)