Commit 8b9917ab authored by gem2578's avatar gem2578

Added sided_reflect

parent b1363311
......@@ -2,6 +2,7 @@ from abc import ABC, abstractmethod
from model.object_type import ObjectType
from model.cup_object import CupObject
from pygame.math import Vector2
from model.side import Side
class Brain(ABC):
......@@ -35,6 +36,12 @@ class Brain(ABC):
objects.sort(key = lambda agent: self.pos.distance_to(agent.pos))
return objects
def sided_reflect(self, vec):
if self.side == Side.RIGHT:
return vec.reflect(Vector2(1,0))
else:
return Vector2(vec)
@abstractmethod
def action(self):
raise Exception('action() has not been setup')
raise NotImplementedError('action() has not been setup')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment