From ab87e65e188989ea94dd8183dd7a316517368a35 Mon Sep 17 00:00:00 2001 From: Elmar Kresse Date: Wed, 15 Oct 2025 23:42:50 +0200 Subject: [PATCH] fix: clarify scoring system in track placement and guessing logic --- src/server-deno/application/GameService.ts | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/server-deno/application/GameService.ts b/src/server-deno/application/GameService.ts index cc210a3..13479b2 100644 --- a/src/server-deno/application/GameService.ts +++ b/src/server-deno/application/GameService.ts @@ -224,6 +224,15 @@ export class GameService { /** * Check title and artist guess + * + * SCORING SYSTEM: + * - Tokens: Awarded ONLY for correctly guessing BOTH title AND artist + * - 1 token per round (can only get once per track) + * - Used as currency/bonus points + * + * - Score: Number of correctly placed tracks in timeline (timeline.length) + * - Increases only when placement is correct + * - This is the main win condition */ async checkTitleArtistGuess( room: RoomModel, @@ -274,6 +283,11 @@ export class GameService { /** * Place track in timeline + * + * SCORING SYSTEM: + * - Correct placement: Adds track to timeline, increasing score (timeline.length) + * - Incorrect placement: Track is discarded, no score increase + * - NO tokens awarded here - tokens are only from title+artist guesses */ async placeInTimeline( room: RoomModel, @@ -318,7 +332,7 @@ export class GameService { logger.warn(`Track has no year: ${track.title}`); } - // Update timeline if correct + // Update timeline if correct (score is the timeline length) if (correct) { const newTimeline = [...timeline]; newTimeline.splice(slot, 0, { @@ -328,19 +342,18 @@ export class GameService { artist: track.artist, }); room.state.timeline[playerId] = newTimeline; - - // Award 1 token for correct placement (independent of title+artist token) - room.state.tokens[playerId] = (room.state.tokens[playerId] || 0) + 1; + // Score increases automatically (it's the timeline length) + // NO token awarded here - tokens are only from title+artist guesses logger.info( - `Player ${playerId} correctly placed track in timeline. Awarded 1 token for placement.` + `Player ${playerId} correctly placed track in timeline. Score is now ${newTimeline.length}.` ); } else { // Discard the track room.discard.push(track); logger.info( - `Player ${playerId} incorrectly placed track. No token awarded.` + `Player ${playerId} incorrectly placed track. No score increase.` ); }