X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fplayer.py;h=d47e82682cce298a57424eaae1918d3f100e9615;hb=HEAD;hp=58cb8245e6c5f0f3b466f25bf2d007dba2e544ef;hpb=504157042ced1fab2fe66a906129ca87fdf91297;p=naja.git diff --git a/naja/player.py b/naja/player.py index 58cb824..d47e826 100644 --- a/naja/player.py +++ b/naja/player.py @@ -151,6 +151,13 @@ class Player(object): return True return False + def force_position(self, pos, delta=True): + if delta: + pos = (self.position[0] + pos[0], + self.position[1] + pos[1]) + if (0 <= pos[0] < 5 and 0 <= pos[1] < 5): + self.position = pos + def set_gameboard(self, gameboard): self.gameboard = gameboard