Commit 75727038 authored by gem2578's avatar gem2578

Added mirror_vector

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,11 @@ class Brain(ABC):
objects.sort(key = lambda agent: self.pos.distance_to(agent.pos))
return objects
def mirror_vector(self, x, y):
if self.side == Side.RIGHT:
x = -x
return Vector2(x, y)
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