AI-Project/survival/components/position_component.py
2021-04-19 17:20:40 +02:00

16 lines
434 B
Python

from survival.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)