From 23021a12989b5e5fe943f19a2bf5d76151934418 Mon Sep 17 00:00:00 2001 From: Jonas Zeunert Date: Sat, 7 May 2022 14:35:10 +0200 Subject: [PATCH] active --- PlayerState.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PlayerState.py b/PlayerState.py index 051f7fa..b2f3fa8 100644 --- a/PlayerState.py +++ b/PlayerState.py @@ -47,6 +47,7 @@ class PlayerState: ballsLeft = 0 replayBall = False hasBallScored = False + isActive = False redSpecial = 0 redSpecialLit = False @@ -79,8 +80,12 @@ class PlayerState: self.specialDisplay.printScore() def activate(self): + self.isActive = True self.reset() + def deactivate(self): + self.isActive = False + def enableTiming(self): if config.BONUS_TIME_ALGORITHM == config.BONUS_TIME_ALGORITHM_OPTIONS.RANDOM: self.disableAdvanceTimeLeft() @@ -247,6 +252,9 @@ class PlayerState: self.replayBall = True def addPoints(self, points): + if not self.isActive: + return + if not self.hasBallScored: self.hasBallScored = True