Player may now have affinities to entity types

This commit is contained in:
Marcin Kostrzewski 2020-05-16 10:07:35 +02:00
parent 8cad7be0a5
commit fce8eea181

View File

@ -8,12 +8,14 @@ from src.entities.Statistics import Statistics
class Player(Entity): class Player(Entity):
def __init__(self, spawnpoint, size): def __init__(self, spawnpoint, size, affinities=None):
""" """
Create a player. Create a player.
:type affinities: Affinities
:param spawnpoint: A tuple of coords (x,y) :param spawnpoint: A tuple of coords (x,y)
:param size: The size in px :param size: The size in px
:param affinities: Affinities struct defining player's affinities
""" """
# Entity constructor # Entity constructor
@ -35,6 +37,8 @@ class Player(Entity):
# Player can move only so fast # Player can move only so fast
self.moveTimeout = 100 self.moveTimeout = 100
self.affinities = affinities
def applyWalkingFatigue(self): def applyWalkingFatigue(self):
""" """
Lowers player's statistics. Applied every few steps. Lowers player's statistics. Applied every few steps.