fix game
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 2m0s
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 2m0s
This commit is contained in:
@@ -139,6 +139,7 @@ type Game struct {
|
||||
|
||||
// Highscore
|
||||
localHighscore int
|
||||
roundStartTime time.Time // Startzeit der aktuellen Runde (für Solo)
|
||||
|
||||
// Audio System
|
||||
audio *AudioSystem
|
||||
@@ -271,9 +272,13 @@ func (g *Game) Update() error {
|
||||
}
|
||||
if currentStatus == "RUNNING" && g.lastStatus != "RUNNING" {
|
||||
g.audio.PlayMusic()
|
||||
g.roundStartTime = time.Now()
|
||||
}
|
||||
if currentStatus == "GAMEOVER" && g.lastStatus == "RUNNING" {
|
||||
g.audio.StopMusic()
|
||||
if g.gameMode == "solo" {
|
||||
g.verifyRoundResult()
|
||||
}
|
||||
}
|
||||
g.lastStatus = currentStatus
|
||||
|
||||
|
||||
Reference in New Issue
Block a user