AI-Project/survival/components/position_component.py
2021-06-19 00:09:14 +02:00

16 lines
439 B
Python

from survival.game.enums import Direction
class PositionComponent:
def __init__(self, pos, grid_pos, direction=Direction.DOWN):
self.position = pos
self.grid_position = grid_pos
self.direction = direction
self.direction_change_timer = 0
def rotate_left(self):
return Direction.rotate_left(self.direction)
def rotate_right(self):
return Direction.rotate_right(self.direction)