Show garbage received on player elimination
- Add garbageReceived array to player objects - Track garbage in addGarbageToPlayer() with sender name - Include garbageReceived in getStates() output - Update endGame() to pass garbage stats to UI - Update showGameOver() to display garbage count per player - Add CSS styling for eliminated players and garbage column - Bump CSS version for cache refresh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-2
@@ -140,12 +140,14 @@ class UIManager {
|
||||
this.displays.winnerDisplay.style.color = winner ? '#0f0' : '#fff';
|
||||
|
||||
this.displays.finalScores.innerHTML = '';
|
||||
Object.entries(scores).forEach(([name, score], index) => {
|
||||
Object.entries(scores).forEach(([name, data], index) => {
|
||||
const item = document.createElement('div');
|
||||
item.className = 'score-item' + (index === 0 ? ' winner' : '');
|
||||
if (data.eliminated) item.classList.add('eliminated');
|
||||
item.innerHTML = `
|
||||
<span>${this.escapeHtml(name)}</span>
|
||||
<span>${score}</span>
|
||||
<span>Score: ${data.score}</span>
|
||||
<span class="garbage">Garbage: ${data.garbageReceived}</span>
|
||||
`;
|
||||
this.displays.finalScores.appendChild(item);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user