diff --git a/entities/player.py b/entities/player.py index 9bdfbf5..ee8e523 100644 --- a/entities/player.py +++ b/entities/player.py @@ -178,6 +178,28 @@ class BrSimPlayer(): return False self.inventory.append(item) + def _move(self, delta_x, delta_y): + # XXX maps limits: + # probably this isn't player's business + # game orchestror should manage it + # to avoid that the player can go out from the map + # or can reach unaccessible points + # also because the player doens't know the Map (entities/gamemap.py) + self.coord_x += x + self.coord_y += y + + def move_right(self): + self._move(1, 0) + + def move_left(self): + self._move(-1, 0) + + def move_top(self): + self._move(0, 1) + + def move_bottom(self): + self._move(0, -1) + def escape(self): # TODO It can run away from the fighting return