Commit Graph

9 Commits

Author SHA1 Message Date
Brian Fertig 5e49c055a2 refactor: support per-node map art sizes and rebrand campaigns
- Refactor level select scene to handle variable node texture dimensions
  instead of assuming all node art is centered on a 960×540 canvas
- Change BADGE_FILE_FRAC and nodeDisplaySize to accept per-state keys,
  allowing map_node_current (512×512 badge) to differ from the other
  nodes (960×540 frames)
- Update map_finish to use its new 512×512 tight export; reduce its
  display scale accordingly
- Rename campaigns: "Sunny Suburbs" → "Evergreen Lake",
  "Dusk Junction" → "Underprivileged Community"
- Update asset manifest dimensions and sprites.md documentation
2026-08-21 15:40:47 -06:00
Brian Fertig 6229f9529b Refactor level select into campaign map with auto-layout
Replace the flat level-grid level select screen with a campaign-based
map view. Levels are grouped into themed campaigns (e.g. "Sunny Suburbs",
"Dusk Junction") each with its own background art and node positions
rendered along a Catmull-Rom spline ribbon.

Key changes:
- Introduce CAMPAIGNS array in src/data/levels/index.js with helpers for
  campaign/level lookup.
- Add src/data/levels/positioning.js for auto-layout S-curve generation
  and Catmull-Rom spline sampling.
- Rewrite LevelSelectScene.js to render per-campaign maps with animated
  node entrance, idle pulse on the current level, hover states,
  tool-tips for locked levels, and ← → / P keyboard navigation.
- Remove the now-unused LevelCompleteScene; scores now record progress
  and return directly to the map via LevelScoreScene.
- Add map assets (campaign backgrounds, node/flag/tag sprites) and
  manifest entries with a documented 960x540 centered-canvas convention.
- Add src/util/mapArt.js for shared map geometry constants and scaling.
2026-08-21 12:41:49 -06:00
Brian Fertig 6cf184fd4d feat: replace text titles with poster art backgrounds and animated logo
- IntroScene: use bg_main.png poster art as full background, layer
  logo.png with a breathing tween aligned to the baked wordmark via
  fitted similarity transform constants, and add a double-stroke
  "Press any key" prompt (replaced auto-advance with input-only trigger).
- MainMenuScene: replace text title with bg_menu.png background and
  centered logo.png overlay; add semi-transparent background pill to
  instructions text for readability over the treeline.
- LevelSelectScene: add bg_menu.png background and background pill to
  back button text for contrast.
- assetManifest: register bg_main, logo, and bg_menu textures.
- New assets: bg_menu.png, ctc.png, paid.png, bg_main.png, logo.png.
2026-08-20 14:35:21 -06:00
Brian Fertig e7cb1d907a fix(terrain): align physics body with drawn terrain line
Correct the rectangle center offset calculation in Terrain to account
for both X and Y components perpendicular to each segment. Previously,
only the Y offset was applied, causing physics bodies to shift sideways
on sloped terrain. This fix resolves the bus visibly riding above or
through the ground on non-flat segments.

Also adds background and logo assets.
2026-08-20 13:16:57 -06:00
Brian Fertig 0c80e4774e feat: add finish line visual and kid fall voice lines
- Add checkered finish line entity with rippling flag pole (purely visual)
- Add three kid fall voice clips with random playback on kid ejection
- Add load tolerance for optional voice assets matching voiceLine.js pattern
- Preload kid fall sounds in PreloadScene and wire into KidManager
2026-08-20 11:00:31 -06:00
Brian Fertig 3b8c13fb4e feat: complete level 01, engine audio, menu music, editor enhancements
- Implement EngineSound system that pitches engine-heavy.mp3 based on rear
  wheel angular velocity, with rate smoothing to avoid stair-stepping
- Add continuous menu music across Intro → MainMenu → LevelSelect scenes
- Add per-level voice-over support (level01: "Get the Money!")
- Redesign level01 with hand-crafted terrain sections (Flat, Incline,
  Jump, Roller, Descent, Bumps, Flat, Descent, Bumps, Flat)
- Editor: per-section width and vertical scale (vScale) controls
- Editor: smooth entry blending between sections using angle-based
  interpolation (avoids slope overshoot from naive height blending)
- Editor: new size-panel UI with range/number inputs and smooth checkbox
- Fix KidManager re-boarding: ejected kids must be settled before
  re-boarding to prevent mid-air teleportation
- Load audio assets in PreloadScene; handle missing voice files gracefully
2026-08-20 10:10:19 -06:00
Brian Fertig c4954b2292 Replace impact-based kid ejection with open-top compartment
Ejection used to be g-force-triggered, but the suspension isolates the
chassis from shocks so the old threshold was effectively unreachable -
kids were never actually being ejected. Instead the bus now carries an
invisible three-sided box (floor + left/right walls, deliberately no
ceiling) pinned to the chassis with rigid constraints. The fixtures are
standalone bodies in a dedicated kid collision category, not compounded
into the chassis, because Matter only consults the root body's filter
on compounds, so only standalone bodies can be made to collide with kids
while the chassis part stays exempt.

KidManager now checks each kid's rotation-corrected chassis-local
position every physics tick and flips state in both directions: crossing
above the open top marks the kid ejected (light custom gravity,
kid_ejected texture), and drifting back down through it re-marks the kid
aboard. A per-tick hard clamp keeps kids from tunneling through the
floor/walls on a fast hit. Seat constraints and the settle timer are
gone - containment is purely physical collision. GForceMonitor is
demoted to a debug-only readout for landing diagnosis.

Kid art is now 5-frame spritesheets (one distinct kid per seat), with
the frame picked by seat index in Kid.js, and render order is fixed with
explicit depths (kids 1, bus chassis/wheels 2).
2026-08-19 21:05:08 -06:00
Brian Fertig 4973b22f7c Add level editor and retune physics/camera for bouncier, floatier driving
- New browser level editor (editor.html + src/editor/): assemble levels
  from snap-together section generators (flat/inclines/hills/ditch/jump)
  with a live canvas preview, metadata form, and export to ready-to-drop
  levelNN.js source; example export registered as level04.js.
- Add parallax background sprites (bg_far/mid/near).
- Bus retune: softer, bouncier suspension (stiffness 0.45->0.35, damping
  0.08->0.035, travel 12->30, restitution 0.3->0.45) with wheel rest
  point raised 22->34 for a bouncier stance; drive force cut ~60%
  (0.011->0.0045) for a much longer runway and lower top speed.
- Gravity 1 -> 0.675 for ~1.5x hang time off jumps; constraintIterations
  2 -> 10 so the soft wishbone springs converge within one step.
- Bus: clamp each wheel to the underside of its wishbone anchor line on
  every matter afterupdate, fixing wheels punching through to the
  mirrored solution and sticking high on the chassis after hard impacts;
  add no-op destroy() for the world listener.
- CameraRig: speed-driven horizontal lookahead (bus framed ~10% from the
  left edge at rest, out to 1/3 of the screen at speed) via followOffset;
  PlayScene scales the g-force grace period to 5.5s for the new gravity
  and calls the new update()/destroy() hooks.
- Extend level01's terrain runway by 30x.
2026-08-19 20:07:24 -06:00
Brian Fertig 34960a2321 Initial Commit 2026-08-18 20:23:33 -06:00