...
 
Commits (3)
......@@ -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.rotate(180)
else:
return Vector2(vec)
@abstractmethod
def action(self):
raise Exception('action() has not been setup')
raise NotImplementedError('action() has not been setup')
......@@ -14,7 +14,7 @@ class Player(rs.Round):
colour = config.LEFT
else:
colour = config.RIGHT
pos = pygame.math.Vector2(config.SIZE[0] - pos[0],pos[1])
pos = pygame.math.Vector2(config.SIZE[0] - pos[0], config.SIZE[1] - pos[1])
super().__init__(30, colour)
self.rect.center = pos
......