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:
@@ -245,6 +245,11 @@ func (g *Game) UpdateGame() {
|
||||
|
||||
g.SendInputWithSequence(input)
|
||||
|
||||
// Solo: Lokale Prüfung der Runde (Tod/Score)
|
||||
if g.gameMode == "solo" {
|
||||
g.checkSoloRound()
|
||||
}
|
||||
|
||||
// Trail: store predicted position every physics step
|
||||
g.trail = append(g.trail, trailPoint{X: g.predictedX, Y: g.predictedY})
|
||||
if len(g.trail) > 8 {
|
||||
|
||||
@@ -168,7 +168,7 @@ func (g *Game) drawGameOverScreen(screen *ebiten.Image, myScore int) {
|
||||
text.Draw(screen, "SUBMIT SCORE", basicfont.Face7x13, submitBtnX+50, submitBtnY+25, color.White)
|
||||
} else if g.gameMode == "solo" && g.scoreSubmitted {
|
||||
// Solo: Zeige Bestätigungsmeldung
|
||||
text.Draw(screen, "Score eingereicht!", basicfont.Face7x13, ScreenWidth/2-70, ScreenHeight-100, color.RGBA{0, 255, 0, 255})
|
||||
text.Draw(screen, "✓ Runde verifiziert & Score eingereicht!", basicfont.Face7x13, ScreenWidth/2-110, ScreenHeight-100, color.RGBA{0, 255, 0, 255})
|
||||
} else if g.gameMode == "coop" && !g.isHost {
|
||||
// Coop Non-Host: Warten auf Host
|
||||
text.Draw(screen, "Warte auf Host...", basicfont.Face7x13, ScreenWidth/2-70, ScreenHeight-100, color.Gray{180})
|
||||
|
||||
@@ -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