some endgame stuff

This commit is contained in:
Jonas Zeunert
2022-08-30 19:38:29 +02:00
parent 1b13b24d89
commit e2fc1894b5

View File

@@ -1,3 +1,4 @@
import config
from Event import Event from Event import Event
from events.EndGameEvent import EndGameEvent from events.EndGameEvent import EndGameEvent
@@ -31,8 +32,9 @@ class EndBallEvent(Event):
self.scorePoints() self.scorePoints()
self.gameState.currentPlayer.deactivate() self.gameState.currentPlayer.deactivate()
if self.gameState.currentPlayer.ballsLeft == 0: if self.gameState.currentPlayer.ballsLeft == 0 and self.gameState.currentPlayer.id == config.MAX_PLAYERS - 1:
EndGameEvent().trigger(None) EndGameEvent().trigger(None)
return
self.gameState.nextPlayer() self.gameState.nextPlayer()