forked from Cryz/battle_royale_sim
player movements
This commit is contained in:
@@ -178,6 +178,28 @@ class BrSimPlayer():
|
|||||||
return False
|
return False
|
||||||
self.inventory.append(item)
|
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):
|
def escape(self):
|
||||||
# TODO It can run away from the fighting
|
# TODO It can run away from the fighting
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user