Private
Public Access
1
0

fix game
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 2m0s

This commit is contained in:
Sebastian Unterschütz
2026-04-22 11:38:35 +02:00
parent a6cfc055be
commit 2286c18432
5 changed files with 29 additions and 7 deletions

View File

@@ -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