Add player names to snake display
Show human-readable player names instead of player IDs in both desktop and web clients. Player names are now stored in the Snake model and synchronized across all clients. Changes: - Added player_name field to Snake model - Updated create_snake() to accept player_name parameter - Desktop client shows "YOU:" or "PlayerName:" - Web client shows "You (Name)" or "Name" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -322,8 +322,8 @@ class GameClient {
|
||||
const nameSpan = document.createElement('span');
|
||||
nameSpan.className = 'player-name';
|
||||
nameSpan.textContent = snake.player_id === this.playerId ?
|
||||
`You (${snake.player_id.substring(0, 8)})` :
|
||||
snake.player_id.substring(0, 8);
|
||||
`You (${snake.player_name})` :
|
||||
snake.player_name;
|
||||
|
||||
const scoreSpan = document.createElement('span');
|
||||
scoreSpan.className = 'player-score';
|
||||
|
||||
Reference in New Issue
Block a user