Compare commits

..

13 Commits

Author SHA1 Message Date
Viktor Rådberg
fb3dade82d fix not covering the screen 2025-11-17 19:49:49 +01:00
Viktor Rådberg
13c0b9c650 bump 2025-11-17 00:55:57 +01:00
Viktor Rådberg
1d00f04a97 keep score when resume 2025-11-17 00:54:36 +01:00
Viktor Rådberg
b530827d05 spacing 2025-11-17 00:51:09 +01:00
Viktor Rådberg
29872dc00f better position 2025-11-17 00:40:01 +01:00
Viktor Rådberg
e3d0cba637 correct rotation 2025-11-17 00:26:42 +01:00
Viktor Rådberg
60371264b1 score badge 2025-11-16 21:49:25 +01:00
Viktor Rådberg
e0f50ac984 Make forfeit button always visible in player menu
Changed forfeit button to always be visible instead of only when player can lose:
- Removed conditional check in LifeCounter (always passes onForfeit)
- Removed conditional rendering in PlayerMenu (button always shows)
- Button remains functional with safety check inside onClick handler

This makes it easier for players to forfeit at any time during the game.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 18:36:06 +01:00
Viktor Rådberg
309eb47f7a Add showMatchScore setting and forfeit button
Added two new features for better game control:

1. Show Match Score Setting:
   - Added showMatchScore boolean to Settings type (default: true)
   - Added toggle in SettingsDialog to control score visibility
   - Players.tsx now respects the setting when passing matchScore
   - Users can hide score badges in 1v1 games if desired

2. Forfeit Button in Player Menu:
   - Added Skull icon import to PlayerMenu
   - Added onForfeit optional prop to PlayerMenu
   - Added red skull button in player menu buttons section
   - LifeCounter passes forfeit handler (toggleGameLost) to menu
   - Only shows when player can lose (life ≤ 0 or poison/commander damage)
   - Allows players to forfeit game from their individual menu

Both features improve user control over the match scoring system.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 18:33:38 +01:00
Viktor Rådberg
c71dbc2769 Integrate match score into each player card
Changed score display approach to show score directly on each player's card:
- Removed separate ScoreDisplay overlay component
- Added matchScore prop to LifeCounter component
- Created MatchScoreBadge: circular badge in corner of each player card
- Score only displays for 2-player games when score > 0
- Badge positioned in safe corner (adapts to rotation)
- Styled as 12vmin circle with 6vmin text, black/70 background

Score is now part of each player's area rather than a separate overlay.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 18:27:28 +01:00
Viktor Rådberg
873d85ca18 Move score display to bottom center position
Changed ScoreDisplay positioning from top-4 right-4 to bottom-4 left-1/2 -translate-x-1/2 to avoid covering game elements:
- No longer overlaps life totals on small screens
- Doesn't interfere with buttons (cog, +/-, skull)
- Uses safe zone at bottom of screen
- Centered horizontally for better visual balance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 18:20:15 +01:00
Viktor Rådberg
ba0fd31a2c Update game over UI to auto-detect winner and simplify flow
Changed the game over flow to automatically detect the winner when only one player remains alive:
- GameOver modal now displays "X won the game!" with winner's name/color
- Shows single "Start Next Game" button instead of winner selection
- Winner is automatically determined when only one player has not pressed their death button
- Simplified and more intuitive user experience

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 14:06:33 +01:00
Viktor Rådberg
a83b4bf01b Add game score tracking feature for 1v1 matches
This feature keeps track of scores between games in 1v1 matches:
- Shows GameOver modal when a player loses, allowing winner selection
- Tracks match scores persistently in localStorage
- Displays current score in the top-right corner during play
- Loser of previous game starts the next game
- Score resets when returning to start menu

Components added:
- GameOver: Modal for selecting the winner after a game ends
- ScoreDisplay: UI component showing current match scores

State management:
- Added gameScore to GlobalSettingsContext
- Modified resetCurrentGame to use configured starting player
- Game over detection in Play component for 1v1 games

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 14:02:40 +01:00

Diff Content Not Available