This commit is contained in:
Jonas Zeunert
2022-08-31 17:58:34 +02:00
parent 6f1941f873
commit bb12a2da17

View File

@@ -28,6 +28,9 @@ class GameState:
self.startIdleLoop()
def nextPlayer(self):
if not self.isStarted:
return
self.currentPlayer = next(self.players)
def startGame(self, playerCount):
@@ -41,6 +44,7 @@ class GameState:
def endGame(self):
self.writeHighscore()
self.players = None
self._currentPlayer = self.dummyPlayer
self.isPlaying = False
self.isStarted = False
logging.info("Game ended")
@@ -50,7 +54,6 @@ class GameState:
self.isIdle = True
self.idleThread = threading.Thread(target=self.idleLoop)
self.idleThread.start()
pass
def stopIdleLoop(self):
logging.info("Stopping Idle Loop")
@@ -58,8 +61,6 @@ class GameState:
self.idleThread.join()
self.deactivate_all()
pass
def deactivate_all(self):
all_cabinet_lamps = [BONUS_LAMPS, BONUS_MULTIPLIER_LAMPS, CHAMP_LAMPS,
UPPER_PLAYFIELD_TIME_LAMPS, TUNNEL_NUMBER_LAMPS,