Commit Graph

664 Commits

Author SHA1 Message Date
Brian Fertig 8ef312ef45
Overhaul Catan and Ticket to Ride with procedural art tables, shared 3D dice, skill-scaled AI, end screens, and headless verification tools
- Catan: bake the wooden table, sea frame, caddy, tray, opponent boards and end screen from code; add piece-supply limits, official bank-shortage rule, per-game stats, AI trade reasons, and a felt dice tray using shared 3D dice
- Ticket to Ride: render an antique parchment map with score track, desk pad HUD, dialogs, sound synth, and scoring ceremony; rewrite the AI as a 1–5 skill ladder with network planning and turn-weighted routing; add forced-pass/stall guard, route lock reasons, per-player stats, and face-up market replacement
- Extract the 3D dice cube math and renderer into src/ui/dice/Dice3D.js so Craps and Catan share one implementation
- Add tools/verifyCatan.js and tools/verifyTicketToRide.js for headless rules, soak, AI ladder, dice, and layout checks
- Enable skill selection for Ticket to Ride in the opponent select screen; make MusicPlayer controls positionable for the map corner
2026-11-25 01:09:43 -07:00
Brian Fertig 07c1d7ba04
Add confirmation prompt when discarding mid-lay-down in Phase 10
- Prevents accidentally ending a turn and wiping staged mat cards by
  prompting before the discard takes effect.
- New `confirmTurn` setting (default on) gates the prompt; toggleable in
  table settings alongside existing warn/hints options.
- Confirmation modal shows current phase, per-group progress, and offers
  "Lay it down" / "Keep building" / "Discard & end turn" actions.
- Settings modal height and row positions adjusted to fit the new option.
2026-11-24 22:22:00 -07:00
Brian Fertig c193d0a4ca
Overhaul Old Maid with card-table kit, AI tells/shuffles, and verification
- Rewrite the game scene on the shared CardTableScene: candlelit Victorian parlour art, oval table, fan hands, drag-to-reorder, dock/pause/rules/scorepad modals, animated deal and pair reveals
- Add shuffle mechanic (applyShuffle) so players can hide the Old Maid's position; AI tracks posKnown and forgets it on shuffles
- Introduce skill-based tells (hopeful/worried) and wantsShuffle bluffing for opponents; lower-skill AIs are honest, high-skill ones mostly bluff
- Allow 1 opponent (minOpponents 1) so Old Maid works as a 2-player game; expose skill selector in OpponentSelectScene
- Track discarded pairs in state and add countCards helper for conservation checks
- Add tools/verifyOldMaid.js covering rules, AI memory/tells, layout collision checks for 2/3/4 players, and an all-AI soak
- Tune Go Fish verification threshold after the no-repeat-target rule change
2026-11-24 21:56:59 -07:00
Brian Fertig 5e7d4bb172
Migrate Go Fish and Hearts to the shared card-table kit
- Rewrite both games on CardTableScene with new table layout (GoFishTable.js,
  HeartsTable.js) and baked room art (GoFishArt.js, HeartsArt.js)
- Add skill-scaled AI for both: Go Fish gains recall/random-ask memory and a
  no-re-ask rule per turn; Hearts tracks voids, the Queen, and moon shots
- Support Go Fish pairs mode, book tracking, and heads-up (minOpponents 1)
- Extend Hearts rules with configurable target score and add/subtract moon modes
- Add headless verification suites (tools/verifyGoFish.js, tools/verifyHearts.js)
  covering rules, AI legality, layout collisions, and all-AI soaks
- Enable skill selection for both games in OpponentSelectScene
2026-11-24 21:53:55 -07:00
Brian Fertig e09986d53f
Rework Uno and Skip-Bo on the shared card-table scene with skill-scaled AIs
- Add `src/ui/cardtable/` kit (CardTableScene base class, TableGeometry,
  TableArt, AITiming) so both games share perspective layout, card sprites,
  ghost hands, plates and opponent pacing.
- Rewrite Uno: official rules plus optional stacking and draw-until-playable,
  UNO! call/catch, Wild +4 bluff/challenge odds, scoring to a target with
  match play, and a 90s-kitchen table with baked card art (UnoArt/UnoTable).
- Rewrite Skip-Bo: skill-scaled AI with stock-chain search and opponent-aware
  discards, match scoring to 500, dining-room table with vintage card art
  (SkipBoArt/SkipBoTable).
- Allow Uno to be played against a single opponent (minOpponents 1).
- Expose the skill slider for uno and skipbo in OpponentSelectScene.
- Add headless `tools/verifyUno.js` and `tools/verifySkipBo.js` covering
  rules, AI legality/skill ordering, layout bounds and all-AI soaks.
2026-11-24 20:57:02 -07:00
Brian Fertig a1bf2bf783
Redesign Phase 10 with a rec-room table, skill-scaled AI, and full tooling
- New perspective card-table layout (Phase10Table.js) and baked art module
  (Phase10Art.js): wood-paneled room, chrome-rim vinyl top, placemats,
  ghost hands, glow/spotlight effects, per-player-count backgrounds.
- Phase10Game rewritten around persistent card sprites with pose-based tweens:
  deal animation, staged laydowns on mats, hit/discard fly-ins, skip slams,
  turn spotlight, plate ladders, dock prompts, sort controls, tooltips, and
  keyboard shortcuts.
- AI (Phase10AI.js) now takes a 1-5 skill level: timing scales with hand
  speed and table pace, lower skills miss laydowns/hits, feed opponents,
  and skip randomly; higher skills avoid feeding phases and target real
  threats. Added adviseHand() for live coaching marks.
- Logic (Phase10Logic.js): orderGroupCards normalizes run position so hits
  work after out-of-order laydowns; skipTargets/applyDiscard enforce valid
  skip targets; takes log tracks discard pick-ups to break card loops.
- PhaseSpec gains groupStatus, laidGroupLabel, groupGoalLabel, cardName for
  live staging coaching and plate labels.
- OpponentSelectScene: enable the skill picker for phase10.
- tools/verifyPhase10.js: headless test suite covering rules, staging
  helpers, AI legality/timing, layout collision checks for 2/3/4 players,
  and an all-AI soak with win-rate assertions.
- NertsArt: export ensureGhostHand so Phase 10 shares the baked ghost-hand
  texture.
2026-11-24 19:08:34 -07:00
Brian Fertig e0fd2e5573
Add per-machine audio system with Gold Rush Gulch theme and speech cues
- Introduce an `audio` block on each machine definition to hold optional
  music, intro, bandit, and dynamite clip paths.
- SlotsGame now plays a per-machine theme track when the view opens and
  falls back to the shared soundtrack pool otherwise.
- Play one-shot intro cue and sequential spin cues (bandit discovery then
  tiered dynamite) after reels stop; cues queue so they never overlap.
- Suppress the stock sticky-wild sfx on Gold Rush Gulch since the bandit
  speech cue replaces it.
- Add music and speech assets for Gold Rush Gulch (theme, intro, bandit,
  one/two/triple dynamite).
2026-11-24 18:19:42 -07:00
Brian Fertig 523b946721
Rework Nerts as a real-time table with paced AI and full visual scene
- Replace the timer-based AI with a perception model (read/notice/pounce/chain/scan) so opponents pace like humans, pounce on awaited cards, and skip pointless work-pile shuffles; add ghost-hand reach/carry timing and a "too slow" race loss
- Add NertsTable.js (Phaser-free projection/layout for 2–4 players, hit-testing, drop snapping) and NertsArt.js (baked table felt/rim/placemats/foundation zone, score pad, ghost hand)
- Rewrite NertsGame.js around persistent card sprites that tween to their state positions: deal animation, countdown, drag with live legal-target highlights, smart click/hotkey plays, idle hints, stall detection with stock rotation/auto-resign, pause/settings modals, count-back scoring and a paper score pad
- Support draw-count setting (1 or 3), opponent pace, and stock rotation/reshuffle in NertsLogic.js; add live foundation counts and completion checks
- Add tools/verifyNerts.js headless suite covering rules, layout bounds/clearance for all player counts, AI pacing invariants, and a multi-round AI soak with card conservation and score checks
2026-11-24 11:08:52 -07:00
Brian Fertig 2d1a673b7e
Rework roulette into a full 3D table with both wheel variants
- Add European single-zero and American double-zero wheels with La Partage
  and the full set of inside bets (splits, corners, streets, trios, basket)
- Rebuild the scene around a perspective-projected felt: baked table art,
  3D wheel bowl/head/ball, chip stacks on the layout, and a dealer's rail
- Plan each spin physically (track, diamond strikes, fret hops) so the ball
  lands on the pre-chosen number instead of a tween to a fixed angle
- Add AI personalities (grinder, sprinkler, martingale, chaser, sections),
  late bets, and per-player memory for the Martingale progression
- Introduce table limits, call bets/racetrack with neighbour stepper, history
  board, wheel cam, speed/felt/table toggles, and tooltips with house edges
- Extract geometry and rules into Phaser-free modules and add a headless
  verification suite covering payouts, hit-testing, AI, and the ball planner
2026-11-24 09:59:28 -07:00
Brian Fertig 7a3205799b
Overhaul craps with full table art, 3D dice, expanded bets, and AI
- Add perspective-projected craps tub: baked felt layout, padded rail, diamond-pyramid walls, house bank, dice bowl, ON/OFF puck (CrapsArt.js)
- True 3D die rendering and physics-lite throw that relabels the cube to match the rolled face (CrapsDice.js)
- Table geometry module with zones, seats, bet lanes, hit-testing shared by art and input (CrapsTable.js)
- Expand rules: Buy/Lay/Big/Hardways and all one-roll props; 3-4-5× odds caps, barred 12s, called-on working, contract bets, come-bet travel, plain-English payout explanations (CrapsLogic.js)
- Rewrite the scene: shared casino dock, per-seat chip stacks in the rail, felt click-through hit-testing, learner hints, roll-history board, results card, speed/felt settings (CrapsGame.js)
- AI profiles gain hardway/prop/lay appetite and injectable RNG for deterministic verification (CrapsAI.js)
- Add headless verifier: 36-combo resolution tables, exact Markov house edges, chip-conservation AI soak, geometry and dice-throw checks (tools/verifyCraps.js)
2026-11-24 09:18:11 -07:00
Brian Fertig d33ab09ae0
Redesign Hold'em table with casino oval art and proper betting rules
- New baked table art (HoldemArt.js) on a shared perspective kit
  (CasinoGeometry.makeProjection), plus layout solver in HoldemTable.js
  that fits cards, stacks, bets and buttons around the felt without overlap
- Correct min-raise tracking via lastRaiseSize; pot odds now include
  current street's bets
- All-in runouts: when nobody can act, deal the board out with live
  equity pills instead of stalling on a single actor
- Side-pot logic fixed so players who bust in the hand still claim their
  share; action skips all-in seats
- New HoldemShowdown.js helpers (bestFive, equity, hand labels, raise
  presets, finishing places) and headless test suite tools/verifyHoldem.js
- Rebuilt UI: casino dock with pre-action toggles, bet slider + pot-size
  presets, tournament panel, TV-style showdown with card glow, busted
  watch/skip flow, and cash-out confirmation on leave
2026-11-23 22:46:40 -07:00
Brian Fertig a103c9ed74
Refactor casino tables to shared perspective geometry and art kit
- Extract table layout into Phaser-free *Table.js modules so headless verify scripts can test projection, hit-testing, payouts, and scoreboard roads
- Add shared casino art pipeline (CasinoArt/CasinoCards/CasinoChips/CasinoDock) that bakes felt, rail, cards, chips, and HUD dock from one perspective model
- Replace per-game hand-drawn tables, betting UI, and chip rendering in Baccarat, Blackjack, and Pai Gow with the shared kit plus game-specific markings
- Add keyboard shortcuts, rebet controls, and a Baccarat bead plate/big road scoreboard
- Extend verifyBaccarat/verifyBlackjack/verifyPaiGowPoker with layout, overlap, and source-lint checks
2026-11-23 20:10:11 -07:00
Brian Fertig b2df177bf3
Add themed attract kits and props for all seven slot machines
- Introduce SlotsAttract.js: a reusable "attract kit" (MachineStage) that builds a lit cabinet, LED light-show state machine, marquee, idle/attract mode, tumble meter, optional background/marquee video, per-machine sound layer, and shared baked textures
- Add per-theme props modules wired through the stage hook contract:
  - SlotsGoldRush.js — wanted poster, TNT plunger, lanterns, ore-cart bonus
  - SlotsDragon.js — sleeping dragon + sneaking knight, jackpot plaques, hold & spin visuals
  - SlotsAbyssal.js — procedural mermaid puppet, pearl ladder, sea life, bubble tumbles
  - SlotsPharaoh.js — winged sun disk, obelisks, tomb doors, expanding wild beam
  - SlotsLucky.js — candle light, rolling odometer, belly glass, coin tray, chrome lever
  - SlotsFruit.js — fruit-stand awning, payline lamps, neon cherries, HOLD/NUDGE push-buttons
  - SlotsLiberty.js — clockwork gear train, brass bell + striker, coin run, split-flap PAID
- Extend SlotsReels with themed glass backplates, reel peek (vintage drums), idle wobble, dim/spotlight/squash helpers, cell halos, wind-up stop, and anticipation hooks
- Upgrade SlotsFx with per-theme line styles (gold vein, fire, bubbles, sunbeam, lamp, slash), glow cells, confetti, bubble bursts, accelerated counter ticks, and themed coin textures
- Update SlotsGame to route attract machines through MachineStage, add a bottom control bar, modal paytable overlay, and per-machine props registry; refactor video loading into loadLoopVideo
- Add seven background loop videos under assets/videos/slots/
2026-11-23 19:01:33 -07:00
Brian Fertig 7e31a68794
Add attract videos to slots lobby cards and background
- Loop a muted casino-floor clip behind the lobby with a dim layer for readability
- Play per-machine attract clips in each card's marquee area, unmuting on hover
- Fall back to existing static art if video fetch or playback fails
- Remove best-win/jackpot stat text from cards and reposition marquee lights
2026-11-23 14:36:35 -07:00
Brian Fertig d0d412cea9 Add Geometry Wars arcade shooter with warp grid and neon bloom
- Headless sim (GeometryWarsLogic) with evolved and pacifism modes,
  seeded RNG for deterministic replays, and a fixed-tick accumulator loop
- Spring-lattice warp grid that reacts to bullets, explosions and black holes
- Additive neon bloom post pipeline plus a particle field for streaks/rings
- Vector font, title screen with mode cards, HUD, pause and game-over panels
- Register the game in the registry, scene dispatch, soundtrack and assets
- tools/verifyGeometryWars.js: headless checks incl. a bot soak across seeds
2026-10-04 19:56:07 -06:00
Brian Fertig e3c764a981 Add toggleable rules panel to Tents game
- Introduce a slide-in "How to Play" panel listing the four Tents rules,
  kept in sync with the engine's own rule comment so the UI can't drift.
- Add a Rules button in the HUD parked where the panel's Close button will
  appear, so opening reads as one control morphing rather than two controls.
- Animate the panel open/close and swap visibility/interactivity between the
  Rules and Close buttons to avoid stacking both in the same spot.
2026-10-01 19:42:47 -06:00
Brian Fertig 9d82073e5a Update game icons in PNG and PSD assets 2026-09-14 19:54:31 -06:00
brianfertig 068da0a8ce Merge pull request 'Defender' (#12) from Defender into main
Reviewed-on: #12
2026-09-06 23:45:31 +00:00
Brian Fertig ed7620ee7b Replace chevron player ship with detailed asymmetric interceptor silhoue
- Introduce SHIP_HULL polygon and ENGINE_COLOR for a sharper, cyberpunk-style ship
- Swap strokeChevron for drawShip, adding fuselage spine, canted canopy, dorsal-fin greebles, and a speed-reactive neon engine flare
- Update lives readout to render mini ship glyphs instead of chevrons
2026-09-06 17:44:19 -06:00
Brian Fertig 03d35b0b00 Overhaul boss encounters into distinct escalating profiles per level
- Replace flat kind/secondaryKind model with named BOSS_PROFILES that each carry their own move list, speed multiplier, and attack cooldown, so later fights are harder along every axis at once.
- Add six new attack patterns (ring, spread, spiral, aimed, wall, reinforce) dispatched via round-robin; bosses under half health can swap to a harder phase2Moves set.
- Surface the boss name in the WARNING banner and extend its display time.
- Extend verifyDefender.js with check 10: asserts HP/cooldown monotonicity, valid move names, dual-phase presence, and live-simulates each level's boss to confirm declared move ordering and phase-2 takeover.
2026-09-06 15:54:20 -06:00
Brian Fertig 79fb74d9b2 Add Defender arcade game with wireframe rendering and headless verificat
- Implement full Defender gameplay: boids swarmers, walkers, abductors, boss fights, humanoid rescue/escape state machine, combo multiplier, and overdrive timescale across 5 levels
- Render all entities as procedural Graphics strokes (glow-stroke pair) with a toroidal wraparound world, per-level accent palettes, CRT overlay, and a custom vector font for banners/title
- Register the game in the registry, scene dispatch, asset manifest, and soundtrack overrides so it appears alongside other arcade titles
- Add tools/verifyDefender.js covering wrap math, seam-adjacent boids, every rescue transition, overdrive thresholds, entity leak bounds, boss/level tally, spiral-of-death guard, determinism, and a Monte-Carlo bot soak
2026-09-06 15:14:42 -06:00
brianfertig 71a919e0cb Merge pull request 'Add animated background video and still backdrop to Spelling Bee' (#11) from Game-Polish into main
Reviewed-on: #11
2026-09-03 02:57:38 +00:00
Brian Fertig 5a5f30bca7 Add animated background video and still backdrop to Spelling Bee
- Loop a muted bee-on-flower clip behind the board during the intro,
  fading it in over the felt base with a dim layer for readability.
- Reveal the difficulty panel on the first full loop of the clip, with a
  ~20s fallback timer and an immediate reveal on video load/playback error.
- Swap the intro clip for a preloaded honeycomb PNG once a puzzle starts;
  fall back to the felt rectangle if the image is unavailable.
- Register the still background in the asset manifest so GameRoomScene
  preloads it before the scene launches.
2026-09-02 20:55:06 -06:00
brianfertig 858dc9535d Merge pull request 'Game-Polish' (#10) from Game-Polish into main
Reviewed-on: #10
2026-09-02 05:10:11 +00:00
Brian Fertig 52eaff8b96 Add word-steered board generation and level-scaled special tiles to Book
- Introduce BookworkSteering with context-aware letter placement: class
  steering, vowel-band control, and a real-word completion boost so boards
  stay playable and avoid dead/vowel-clumped states across refills.
- Make gold/diamond spawn chances configurable per level via a linear ramp
  (specialTiles in bookwork.json), wiring the values through clearAndRefill
  and refillSteered instead of hard-coded constants.
- Add verifyBookwormBoard harness comparing baseline vs steered boards on
  word availability, dead-board rate, and simulated session survival, and
  extend verifyBookwork with special-tile schedule checks.
2026-09-01 23:09:12 -06:00
Brian Fertig 44de2fb049 Rename Bookwork to Bookworm and add dictionary-steered grid generation
- Update display name in registry, scene title, README, and tooling references
- Load ENABLE word list at runtime; fall back to unsteered random on failure
- Introduce makeSteeredGrid/refillSteering helpers for class/vowel-aware letter placement
- Export LETTER_WEIGHTS from BookworkLogic for reuse by the steering module
- Add `steer` tuning block (wordBoostK, classThreshold/damp/boost, vowelBand) to bookwork.json
2026-09-01 22:57:07 -06:00
brianfertig e3d2fdee34 Merge pull request 'Game-Polish' (#9) from Game-Polish into main
Reviewed-on: #9
2026-09-02 02:51:15 +00:00
Brian Fertig 3c2cf462ed Polish Mahjong layout: reposition portraits and reference panel
- Rename card back themes (Cthulhu, Cyberpunk, Nautical, etc.) and update
  artwork assets to match
- Move player portraits just left of each seat's tiles so they read as
  belonging to that player without covering any tile
- Reposition the "Hands" reference button clear of seat 2's melds/bonus
  tiles, and hide seat 1's portrait video while the panel covers it
- Auto-close the open reference panel whenever claim or win/kong buttons
  appear so nothing clickable is hidden
2026-09-01 20:49:47 -06:00
Brian Fertig 93db9ef9dc Fix ghost button hover state to use full opacity and correct text color 2026-09-01 20:03:10 -06:00
brianfertig ae30c66a3a Merge pull request 'Polish' (#8) from Polish into main
Reviewed-on: #8
2026-09-01 04:46:09 +00:00
Brian Fertig 429102105b Persist last selected category across menu restarts
- Track the most recently chosen category in module scope so it survives scene.start() reusing the same instance.
- Fall back to that value when entering the menu without explicit category data, restoring the user's previous selection instead of defaulting.
2026-08-31 22:45:22 -06:00
Brian Fertig 1298648e97 Polish opponent select scene and restore category on return
- Replace flat title/subtitle pills with brass Plaque headers in OpponentSelectScene for visual consistency with the game menu
- Shift opponent scroll area down (OPP_SCROLL_TOP 155 -> 180, height 440 -> 415) to clear the subtitle plaque band
- Pass selected category back to GameMenu via scene.start data on Back so the active grid is restored instead of resetting to default
- Add GameMenuScene.init() to capture incoming category and reset stale instance props (_currentCategory, _gridAnim) since scene.start reuses the existing instance
- Guard fadeIn target list with .filter(Boolean) to skip any uncreated elements
2026-08-31 22:21:03 -06:00
Brian Fertig 74cd4df85b Polish title plates with rounded brass-trimmed plaque and size animation
- Replace flat black rectangles behind the game-menu and landing titles with a new Plaque component that draws a rounded, accent-bordered plate with a soft drop shadow and warm top highlight.
- Add letter-spacing and text shadow to the menu title so it reads as raised against the plate.
- When the tab label swaps (e.g. "Loading…" → "Choose a game"), tween the plaque to its new width via a size proxy that redraws each frame, and pop the title text with a Back.easeOut scale so the change feels intentional.
2026-08-31 20:55:29 -06:00
Brian Fertig cbec3b3a44 Polish game menu and landing scene transitions
- Add slide-in/out grid animations when switching categories in the game menu, replacing the instant rebuild
- Rename "Choose a game" to "Choose a Game Category" and update title dynamically on category change
- Fade in menu controls (tabs, hint, back button) on entry to complete the landing handoff
- Animate logo zoom-out and fade buttons out when transitioning from landing to game menu via goToGameMenu()
- Guard against double-taps and stale avatar loads during scene transitions
2026-08-31 19:53:22 -06:00
Brian Fertig f2108e6258 Remove default category selection in favor of a hint prompt
- Drop the `_lastCategory` module-level state and the logic that pre-selected a tab on scene entry.
- Show a "Select a category above to see its games" hint instead, destroyed once the user picks a category.
2026-08-31 19:39:09 -06:00
brianfertig 4ecfcaee50 Merge pull request 'jigsaw-ui-improvements' (#7) from jigsaw-ui-improvements into main
Reviewed-on: #7
2026-08-31 14:47:28 +00:00
Brian Fertig e319f41ce8 Fix jigsaw tray and win-camera to account for the fixed HUD band
- Tray top now clears the HUD at full zoom-out so an entire piece
  (base cell + tabs + shadow headroom) stays below the bar.
- Win camera centers the board in the area below the HUD rather than
  the whole screen, giving the framed picture room under the bar.
- Add AGENTS.md noting the user handles their own commits/pushes.
2026-08-31 08:44:51 -06:00
Brian Fertig 97adfa642d Fix win-screen counter guard and add Playwright browser smoke test
- piecesBig counter guard used .parent (always undefined on container
  children in this Phaser build — they get .parentContainer), so the
  'PIECES' count-up never rendered; drop the dead guard.
- buttonHit() had the same .parent assumption; use .parentContainer.
- Add tools/smokeJigsaw.mjs: headless-Chromium smoke test driving
  menu -> play -> win showcase (camera settle, counter, confetti,
  frame/shine) -> Play Again -> Menu -> play again, asserting zero JS
  errors. Verified pass in browser.
2026-08-31 08:26:32 -06:00
Brian Fertig 18d89d4553 Redesign jigsaw win screen with zoomed board view and celebration effect
- Frame the completed puzzle large on the right while parking stats/actions in a left-hand panel, easing the camera into place
- Add staggered slide-in choreography for title, time, stats (with piece counter), and action buttons
- Fire confetti burst + falling curtain, a shine sweep, and a pulsing gold frame when the win camera lands
- Introduce exitWin() so restart/menu pull the camera back and slide the panel out before rebuilding state
- Simplify pinHUD() now that HUD/win overlay render through the fixed hudCam
2026-08-31 08:11:27 -06:00
brianfertig 0c59a292a3 Merge pull request 'Rework jigsaw UI with stitched mat playfield and two-column menu' (#6) from jigsaw-ui-improvements into main
Reviewed-on: #6
2026-08-31 05:30:00 +00:00
Brian Fertig 243d2e143c Rework jigsaw UI with stitched mat playfield and two-column menu
- Replace the flat felt background with a canvas-generated beige fabric mat (border band, dashed stitching, subtle weave tile, vignette) plus a deeper "pocket" panel behind the board so pieces read as resting on a puzzle mat.
- Add soft drop shadows to jigsaw pieces via an extra shadow pass before the art fill, and pad the piece canvas so the shadow isn't clipped.
- Rebuild the menu into two columns (image picker left, difficulty + start right) with tighter vertical rhythm; make the thumbnail box size a `thumbBox` property so preview/border scale together.
- Consolidate panel background+frame pairs (menu, dropdown, win layer) into single graphics objects to simplify tweening and reduce node count.
- Use a separate invisible zone for table pointerdown so the mat image can be swapped without dropping input, and guard `onTableDown` against double-firing while a piece grab is in progress.
2026-08-30 23:11:58 -06:00
brianfertig c29f33e2a3 Merge pull request 'Puzzle' (#5) from Puzzle into main
Reviewed-on: #5
2026-08-31 03:25:35 +00:00
Brian Fertig a7ebb67413 Extend jigsaw initial-image test coverage
Test now also asserts the menu is back to its original shape (no random-start button), the initial preview and thumb name match the random pick, Start Puzzle begins exactly that image, and the original 🎲 Random button still randomises the menu preview.
2026-08-30 21:19:11 -06:00
Brian Fertig 25f5e05a96 Start the jigsaw puzzle picker on a random image
The menu always opened on the first artwork; now imageIndex is randomised right after loadArtwork(), so each visit to the picker shows a different initial puzzle. The existing Random/prev/next buttons are unchanged (previous random-start button reverted in 4f2d299). Test page + CDP driver verify 8 fresh page loads all land on a valid in-range image with its preview loaded, with variety across loads.
2026-08-30 21:14:37 -06:00
Brian Fertig 4f2d29942d Revert "Add one-click random start to the jigsaw menu"
This reverts commit 0740c12ffa.
2026-08-30 21:12:44 -06:00
Brian Fertig 0740c12ffa Add one-click random start to the jigsaw menu
New '🎲 Start Random' button picks a random picture (never the current one when there's a choice) and starts the puzzle immediately, keeping the selected difficulty. Menu panel grows 820→890 to fit it. Headless-chromium test page + CDP driver verify: button placement, 8/8 random starts reach playing state, image variety, single-image guard, and difficulty preservation.
2026-08-30 21:11:15 -06:00
Brian Fertig 19dff633ce Add jigsaw test harness and local phaser.esm.js bundle
- __jig_test.html boots a Phaser game that loads JigsawGame with stubbed artwork/music caches and exposes window.__* helpers for driving piece grab/drop, scene inspection, and coordinate conversion.
- phaser.esm.js is a vendored webpack build of Phaser used as the "phaser" import map target so the harness can run without a package manager.
2026-08-30 21:03:23 -06:00
Brian Fertig 8dee798ae2 Fix jigsaw piece grab when click lands inside custom hit area
- Add pointerdown handler on each piece to forward the event to the central onTableDown resolver; without it, Phaser's topOnly=true consumes the click and the background never sees it, leaving pieces un-grabbable.
- Anchor the hit-area rectangle to the image's displayOrigin instead of (0,0) so the custom hit box tracks the piece's actual rendered position.
2026-08-30 21:02:22 -06:00
Brian Fertig 85fc7c16bf Add piece joining, board locking, and site soundtrack to jigsaw game
- Introduce group-based table assembly: grid-adjacent pieces snap together on the table, drag as one rigid unit, and lock onto the board as a block
- Extract join/lock rules into pure `resolveDrop` in JigsawLogic.js with a headless verification suite (tools/verifyJigsaw.js) covering fit guarantee, joining, locking, and win counting
- Replace the flat top-bar buttons with a "Menu ▾" dropdown panel to free the top-right corner for the shared site music HUD
- Integrate MusicPlayer soundtrack via getGameSoundtrack() and pin it to the fixed HUD camera
2026-08-30 19:49:00 -06:00
Brian Fertig b6299234cf Fix jigsaw camera bounds and piece tray to avoid overlapping the HUD
- Offset main camera scroll/zoom bounds by HUD_H so the play field
  never slides beneath the fixed top bar
- Shift the scattered-piece tray down by HUD_H to keep pieces clear of
  the target image and HUD
- Assign board panel, frame, and reference image to the main camera only
  so the fixed HUD camera doesn't draw their corners into the screen
2026-08-30 19:03:28 -06:00