Commit 925b11b7 authored by gem2578's avatar gem2578

Merge branch '3-added-mirrored-vector2' into 'master'

Added mirror_vector

Closes #3

See merge request !8
parents b1363311 466a606f
......@@ -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)
return Vector2(vec)
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
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) = pos
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