Implemented getFacingCoord method

This commit is contained in:
Marcin Kostrzewski 2020-04-06 00:39:58 +02:00
parent 2af94a27e9
commit a45befd4fa

View File

@ -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):