Private
Public Access
1
0

Add WebAssembly support for assets and chunks, implement gameover screen rendering, and enhance server gameplay logic with dynamic speeds, team naming, and score components.

This commit is contained in:
Sebastian Unterschütz
2026-01-04 14:30:31 +01:00
parent ce51a2ba4f
commit 95d61bf66e
68 changed files with 913 additions and 424 deletions

View File

@@ -252,17 +252,32 @@ func (g *Game) submitScore() {
name = g.teamName
}
// Verwende Team-Name für Coop-Mode, sonst Player-Name
displayName := name
teamName := ""
if g.gameMode == "coop" {
g.stateMutex.Lock()
teamName = g.gameState.TeamName
g.stateMutex.Unlock()
if teamName != "" {
displayName = teamName
}
}
msg := WebSocketMessage{
Type: "score_submit",
Payload: game.ScoreSubmission{
PlayerName: displayName,
PlayerCode: g.playerCode,
Name: name,
Name: displayName, // Für Kompatibilität
Score: score,
Mode: g.gameMode,
TeamName: teamName, // Team-Name für Coop
},
}
g.sendWebSocketMessage(msg)
g.scoreSubmitted = true
log.Printf("📊 Score submitted: %s = %d", name, score)
log.Printf("📊 Score submitted: %s = %d (TeamName: %s)", displayName, score, teamName)
}