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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user