From a45befd4fa2d5a8f0c015896b4f43d685379a6cf Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Mon, 6 Apr 2020 00:39:58 +0200 Subject: [PATCH] Implemented getFacingCoord method --- src/entities/Player.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/entities/Player.py b/src/entities/Player.py index f654149..e69c3f2 100644 --- a/src/entities/Player.py +++ b/src/entities/Player.py @@ -28,8 +28,13 @@ class Player(Entity): def getFacingCoord(self): if self.rotation == Rotations.NORTH: - return (0, -1) + return self.rect.x, self.rect.y - (self.rect.h) elif self.rotation == Rotations.SOUTH: + return self.rect.x, self.rect.y + (self.rect.h) + elif self.rotation == Rotations.EAST: + return self.rect.x + (self.rect.h), self.rect.y + elif self.rotation == Rotations.WEST: + return self.rect.x - (self.rect.h), self.rect.y # Returns given statistic def getStatistic(self, stat):