From fce8eea181ffb0836f2cc301dcca137279a7659e Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Sat, 16 May 2020 10:07:35 +0200 Subject: [PATCH] Player may now have affinities to entity types --- src/entities/Player.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/entities/Player.py b/src/entities/Player.py index c6c0204..242acc5 100644 --- a/src/entities/Player.py +++ b/src/entities/Player.py @@ -8,12 +8,14 @@ from src.entities.Statistics import Statistics class Player(Entity): - def __init__(self, spawnpoint, size): + def __init__(self, spawnpoint, size, affinities=None): """ Create a player. + :type affinities: Affinities :param spawnpoint: A tuple of coords (x,y) :param size: The size in px + :param affinities: Affinities struct defining player's affinities """ # Entity constructor @@ -35,6 +37,8 @@ class Player(Entity): # Player can move only so fast self.moveTimeout = 100 + self.affinities = affinities + def applyWalkingFatigue(self): """ Lowers player's statistics. Applied every few steps.