def update(self): if self.direction is not None: game_map.removeEntity(self) pos = Vector(self.x, self.y) if self.direction is NORTH: pos.y += 1 pass elif self.direction is SOUTH: pos.y -= 1 pass elif self.direction is EAST: pos.x += 1 pass elif self.direction is WEST: pos.x -= 1 pass if game_map.blocked(pos) is False: self.x = pos.x self.y = pos.y game_map.addEntity(self) self.direction = None pass
def removeFromMap(self): game_map.removeEntity(self)