Deactivate credit while play

This commit is contained in:
Jonas Zeunert
2022-06-07 00:04:48 +02:00
parent ee95711027
commit c67cce5dcc
4 changed files with 6 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ class GameState:
def nextPlayer(self):
self.currentPlayer = next(self.players)
self.isPlaying = True
@property
def currentPlayer(self):

View File

@@ -25,6 +25,6 @@ RED_SPECIAL_TIMES = 1
ORANGE_SPECIAL = SpecialEvent.points
ORANGE_SPECIAL_BANK = ORANGE_SPECIAL_BANK_OPTIONS["BOTH"]
## Tech config
WAIT_TIME_TO_RESET_SECONDS = 0.6
WAIT_TIME_TO_RESET_SECONDS = 0.2
MAX_NETWORK_RETRIES = 10
NETWORK_SLEEP_TIME_SECONDS = 0.05

View File

@@ -20,6 +20,7 @@ class EndBallEvent(Event):
StartBallEvent().trigger(None)
return
self.gameState.isPlaying = False
self.gameState.currentPlayer.removeBall()
self.scorePoints()

View File

@@ -11,6 +11,9 @@ class StartGameEvent(Event):
super().__init__("Start Game Event")
def trigger(self, target):
if self.gameState.isPlaying:
return
super().trigger(target)
self.flipper.activate()