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

16 lines
482 B
Python

class CollisionDirection:
LEFT = 0
RIGHT = 1
TOP = 2
BOTTOM = 3
INSIDE = 4
DIRECTION_NAMES = ['LEFT', 'RIGHT', 'TOP', 'BOTTOM', 'INSIDE']
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]