• Mahmoud Aglan's avatar
    fix: 30 UX improvements — make backgammon fully playable · 1e086492
    Mahmoud Aglan authored
    Game Controller (backgammon-game.js) rewrite:
    - Fix selection: click same piece to deselect, click another to swap
    - Bar enforcement: must enter from bar first with clear message
    - Auto-pass when no moves remain for unused dice
    - Bot waiting status message visible during thinking
    - Opening roll shows clear "your turn" status with dice values
    - Pass button action for truly stuck positions
    - Smart move validation with proper die tracking
    - Individual bot move logging
    - Source validation: only select pieces that have moves
    
    UI (backgammon-ui.js) rewrite:
    - setSelected directly applies DOM classes (no render cycle needed)
    - Status text system: guides player ("Select piece", "Choose target")
    - Movable checkers highlighted with golden ring when it's your turn
    - Dice remaining indicator text below dice
    - Pass/skip button shown when stuck
    - Active player gold border highlight
    - Tap feedback animation
    - Hover preview on valid targets
    - New game button in result overlay
    - Valid target points show dashed circle indicator
    
    CSS additions:
    - .bg-point--clickable with gold ring on top checker
    - .bg-point--hover-preview green tint
    - .bg-move-flash animation
    - .bg-status, .bg-pass-btn, .bg-dice-remaining styles
    - .bg-new-game-btn in overlay
    - Valid point dashed circle indicator
    Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
    1e086492
backgammon-game.js 13.5 KB