Skip to content

Implement Double Trouble mode and rebrand Krelles Casino#32

Merged
krellekrelle merged 2 commits into
mainfrom
feature/krelles-casino-improvements
Jun 3, 2026
Merged

Implement Double Trouble mode and rebrand Krelles Casino#32
krellekrelle merged 2 commits into
mainfrom
feature/krelles-casino-improvements

Conversation

@krellekrelle

@krellekrelle krellekrelle commented Jun 3, 2026

Copy link
Copy Markdown
Owner

This pull request introduces significant enhancements to the Russian Roulette game logic and frontend, focusing on supporting a "Double Trouble" mode with dynamic stake calculation, improving session/lobby management, and refining the user interface for both Russian Roulette and Higher or Lower games. The backend now tracks and exposes stake amounts, units, and multipliers, while the frontend displays this information clearly and provides improved post-game actions.

Russian Roulette: Double Trouble & Stake System

  • Added support for a "Double Trouble" mode: each blank shot doubles the stake, tracked by a new DoubleTroubleMultiplier in RussianRouletteState. The stake amount and unit are now defined in RussianRouletteSettings, replacing the previous free-form label. These values are included in game state and action results, allowing the frontend to display the current and final stakes owed by the loser. [1] [2] [3] [4] [5] [6] [7]

  • The frontend (GameView.jsx, GameView.css) now shows the current stake, multiplier, and unit during gameplay and after the game ends. The UI clearly indicates the amount owed by the loser and highlights the Double Trouble multiplier when active. [1] [2] [3] [4] [5]

Session & Lobby Management Improvements

  • Added lobby reset functionality: the session leader can reset a game back to the lobby state, clearing non-leader readiness and engine state. Also, if a lobby leader disconnects, the lobby is dissolved and clients are notified. [1] [2]

  • Improved session join logic: reconnects are always allowed, even after the game has finished, but new joins are only permitted in the lobby state. Open lobbies now only include sessions with at least one player. [1] [2]

Frontend UI/UX Enhancements

  • Both Russian Roulette and Higher or Lower game views now provide prominent "Play Again" and "Leave" buttons after a game ends, with improved layout and styling for post-game actions. [1] [2] [3] [4] [5]

  • Updated navigation bar and button labels for clarity ("Krelles Casino", "← Leave").

Dependency and Package Updates

  • Updated the frontend's package-lock.json to properly link the local @platform/ui-library package. [1] [2]

- Replace StakeDisplay with StakeAmount (default 25) + StakeUnit (default DKK)
- Add DoubleTroubleEnabled setting: each blank shot doubles the current stake
- Track DoubleTroubleMultiplier in engine state
- Expose stakeAmount, stakeUnit, doubleTroubleEnabled, currentStake in public state
- Include finalStake and stakeUnit in TriggerResult event payload
- Rename to 'Krelles Casino' throughout UI
- Add pre-game settings modal on landing page (configure before lobby is created)
  - Russian Roulette: chambers, stake amount/unit, Double Trouble toggle
  - Higher or Lower: base fine, unit
  - Double Trouble disclaimer shows full doubling chain and max fine with odds
- Lobby: updated RR settings form (stake amount + unit fields, DT toggle + disclaimer)
- Lobby: finished state shows Play Again (leader resets) / waiting (non-leaders)
- Game views: add Play Again button on post-game screen (navigates back to lobby)
- RR GameView: live stake bar showing current stake with Double Trouble multiplier badge
- Empty lobby cleanup: dissolve leader's lobbies on disconnect, filter empty from list
@krellekrelle
krellekrelle merged commit 66eaa8a into main Jun 3, 2026
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant