debug.py now has a list of 2 actions, attack and move, and every player get a random action from this list
This commit is contained in:
@@ -178,15 +178,15 @@ class BrSimPlayer():
|
||||
return False
|
||||
self.inventory.append(item)
|
||||
|
||||
def _move(self, delta_x, delta_y):
|
||||
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
|
||||
self.coord_x += delta_x
|
||||
self.coord_y += delta_y
|
||||
|
||||
def move_right(self):
|
||||
self._move(1, 0)
|
||||
@@ -195,10 +195,10 @@ class BrSimPlayer():
|
||||
self._move(-1, 0)
|
||||
|
||||
def move_top(self):
|
||||
self._move(0, 1)
|
||||
self._move(0, -1)
|
||||
|
||||
def move_bottom(self):
|
||||
self._move(0, -1)
|
||||
self._move(0, 1)
|
||||
|
||||
def escape(self):
|
||||
# TODO It can run away from the fighting
|
||||
|
||||
Reference in New Issue
Block a user