diff --git a/config.py b/config.py index 30ab4f1..1f1fcec 100644 --- a/config.py +++ b/config.py @@ -29,3 +29,4 @@ WAIT_TIME_TO_RESET_SECONDS = 0.15 MAX_NETWORK_RETRIES = 10 NETWORK_SLEEP_TIME_SECONDS = 0.1 BANK_SLEEP_TIME = 0.1 +BONUS_SLEEP_TIME = 0.1 diff --git a/events/EndBallEvent.py b/events/EndBallEvent.py index 55bddbc..e7b0ecd 100644 --- a/events/EndBallEvent.py +++ b/events/EndBallEvent.py @@ -6,6 +6,11 @@ from events.StartBallEvent import StartBallEvent from solenoids.MainFlipper import MainFlipper from solenoids.TopFlipper import TopFlipper +from time import sleep +from config import BONUS_SLEEP_TIME + +from lamps.LampGroup import BONUS_LAMPS + class EndBallEvent(Event): def __init__(self, gameState): self.gameState = gameState @@ -30,5 +35,9 @@ class EndBallEvent(Event): EndGameEvent().trigger(None) def scorePoints(self): - bonus = self.gameState.currentPlayer.bonus * self.gameState.currentPlayer.bonusMultiplier * 1000 - self.gameState.currentPlayer.addPoints(bonus) + currentPlayer = self.gameState.currentPlayer + for i in range(currentPlayer.bonus): + bonus = self.gameState.currentPlayer.bonusMultiplier * 1000 + self.gameState.currentPlayer.addPoints(bonus) + BONUS_LAMPS.deactivateCurrent() + sleep(BONUS_SLEEP_TIME) \ No newline at end of file