sep-pm-platformer/project/physics/CollisionDirection.py

15 lines
457 B
Python
Raw Normal View History

2023-03-26 17:01:28 +02:00
class CollisionDirection:
LEFT = 0
RIGHT = 1
TOP = 2
BOTTOM = 3
DIRECTION_NAMES = ['LEFT', 'RIGHT', 'TOP', 'BOTTOM']
def __init__(self, direction: int, primary_sprite, secondary_sprite):
self.direction = direction
self.primary_sprite = primary_sprite
self.secondary_sprite = secondary_sprite
def to_string(self):
return 'CollisionDirection.' + CollisionDirection.DIRECTION_NAMES[self.direction]