mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 04:45:33 -08:00
24 KiB
24 KiB
Architecture: Ghoul Rush rides
Part of AGENTS.md and the Architecture index: project guidance for AI coding agents.
Ghoul Rush's ride files (the mat, the stair, the cart and the rest). The other games and the rules every game follows are in Activities; Ghoul Rush is split over core, stages and rides.
| File | Role |
|---|---|
public/activities/ghoul-rush/rides/mat/ghoul-mat-room.js |
Down the Hatch's room as data, written by prototypes/ghoul-rush-tools/gen-mat.mjs --write (ready: true; ride.hearts 3) |
public/activities/ghoul-rush/rides/mat/ghoul-mat.js |
Rules for the finale's first ride, Down the Hatch (pack MAT, state in round.runner with id mat): surfing the WELCOME mat down the House's throat, floor lines and gristle ledges over holes, ribs (jump), uvulas (duck), peristalsis squeezes that throb before they close (duck), swallowed furniture (shoot or jump, an act), bile stretches that speed YOU up, three hearts through ride.hearts, mat-prefixed events and causes, no random numbers |
public/activities/ghoul-rush/rides/mat/ghoul-mat-draw.js |
Down the Hatch's drawing: LOOKS.mat (pack mat), VOICES (mat, matsqueeze, matfurn), EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS and matArt(d) (the throat in moving; uvulas, squeezes, the mat and the telegraph glyphs in front; lights, react) |
public/activities/ghoul-rush/rides/mat/ghoul-sfx-mat.js |
Down the Hatch's ghoulMat* tones, the user's picks (MAT_SFX, wired by prototypes/ghoul-rush-tools/wire-mat-sounds.cjs), and its track ghoulMarrowMat |
public/activities/ghoul-rush/rides/bonestair/ghoul-bonestair-room.js |
The Bone Stair's room as data (ready: true), written by prototypes/ghoul-rush-tools/gen-bonestair.mjs |
public/activities/ghoul-rush/rides/bonestair/ghoul-bonestair.js |
The Bone Stair's rules, pack BONESTAIR (ride, place, target), state in round.runner with id bonestair: spiral flights with seams, the rubble's gap meter behind YOU, treads that give way, ribcages, skeletons, bone hands and masonry; causes and events prefixed stair; no random numbers; 3 hearts |
public/activities/ghoul-rush/rides/bonestair/ghoul-bonestair-draw.js |
The Bone Stair's drawing: LOOKS.bonestair, VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS, the telegraph glyphs, and bonestairArt(d): the shaft, the bone treads, the columns, every obstacle, the rubble wall and its meter, and the Pit's dark |
public/activities/ghoul-rush/rides/bonestair/ghoul-sfx-bonestair.js |
The Bone Stair's ghoulStair* tones, the user's picks (BONESTAIR_SFX, wired by wire-bonestair-sounds.cjs), and its track ghoulMarrowStair |
public/activities/ghoul-rush/rides/cart/ghoul-cart.js |
Ghoul Rush's Runaway Cart, the Mine's ride room, its rules (no imports; draws no random number): the first room where a pack takes Planny's movement over. It adds the pack fields ride (a list of (round, ms, k) => true hooks run each slice before the walking rules; one that returns true has moved him) and place (a list of (round, k) hooks run whenever he is put down in a room: a room set up, a respawn), uses target (the crates), and round.camLead (units the camera leads further). The cart (round.cart, null elsewhere) rides the room's ride.track polylines (slope speed, lean and brake, jump, air steering, ramp launch, landing on the line under it, derail into the chasm), ducks under ride.beams, wrecks on rubble and unbroken crates (two bolts break one), is chased by the boulder, passes checks (a life lost puts it back at the last) and halts at stop where the door opens; a ledge imp (ledgeimp) leaps into it and steals light, a canary's scream drops a slide of rubble on the track ahead. Exports flight, trackY, linesAt and linesOf for the unit suite. Events cartJump, cartLand, cartLaunch, cartBrake, cartDuck, crateHit, crateBreak, cartCrash, boulderNear, checkpoint, cartStop, ledgeLeap, slideWarn, slideFall; causes derail, beam, crash, boulder |
public/activities/ghoul-rush/rides/cart/ghoul-cart-draw.js |
The Runaway Cart's art: LOOKS (custom: true, pack: "cart", always dark), cartArt(d) returning backdrop, ground, moving (every frame: the cave in cached parallax tiles over a chasm, the trestled track, ledge pillars, signal posts, rubble and the buffer stop in cached chunks, hanging lamps, signal lamps, crates, a slide's dust and pour; the cart too once it has stopped, so Planny walks out past it), front (the cart over Planny, the beams, the boulder, flying splinters, speed streaks, the foreground rock), lights (headlamp, hanging and far lamps, signals, beams), monsters (the ledge imp) and react; its VOICES (borrowed tones), EVENT_VOICE, LOSE_WORDS and LOSE_SOUNDS. It keeps its own offscreen layer cache (keyed by scale), draws no random numbers (a hash) and leaves short-lived bits in the view's fx (cartBits, cartPours, cartLand, cartStop). Its header lists every field the art reads off the rules |
public/activities/ghoul-rush/rides/lantern/ghoul-lantern.js |
The Drowned Lantern (Gallows Bog's bonus round, not a ride) as a pack (LANTERN): a top-down game on one fixed screen where YOU carry a lantern over an island of mossy hummocks and plank walks round Old Mother Bog's pool, light five wisp shrines (stand on a stone SHRINE_MS, the time kept if you step off), then run back to the boat at the landing. Pack fields ride (moves Planny) and place; state in round.runner (id "lantern"), positions in field units with y counted down; the room's ride holds the island (hummocks, planks as hummock pairs, shrines, start, boat, pool, bodies) and the hunters' tables (lurker route, leeches routes, wisps: a guardian per shrine with its phase, roamers with wake). Keys: arrows walk (a walk into the water slides along the shore or plank, slide), SPACE flares (a ring FLARE_R that bursts wisps and scatters leeches, costing FLARE_OIL; a sputter without the oil); fire() and the arm double-tap are off for this room. The oil burns down over OIL_MS and the light (lightR) with it; a lit shrine fills it. One rule per hunter: the Lurker hears steps on wood, flares and shrines, swims to the spot, lines up a lane through it (AIM_MS) and dashes (it strikes where it heard you), rests deaf, and cowers once Mother rises; guardian wisps circle their shrine and rush a lantern within GUARD_SENSE on a LEASH, roamers leave the pool at the third to fifth shrine; leeches stay at the light's edge and bite only once the flame gutters; bog bodies rise only for someone standing still beside them; Mother's hand (from the third shrine or MOTHER_LATE_S) tracks, locks and slams, one after another once the fifth raises her. Catches cost the bonus round's hearts and never move Planny; lanternMeet names each hunter's rule once; runner.marks lists what a banner must keep clear of (read by ghoul.js's underBanner); lanternHums gives ghoul.js the held sounds; the grade is total 5, hits (kinds that caught you), acts (flare pops and close calls), steady (the flame never guttered). No random numbers; a Planny put at the door finishes too, as a ride's finish line does |
public/activities/ghoul-rush/rides/lantern/ghoul-lantern-draw.js |
The Drowned Lantern's art, the whole field drawn by lanternArt(d).field (like Holy Roller's): LOOKS, VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS, TAGS (each hunter's rule, shown once over it, one at a time); the water and Mother's pool, the island and the boat, then one dark layer with a hole per light (paintDark from ghoul-draw.js), and over it what the dark must never hide: the island's moonlit edges, the shrines' beacons and progress, the bodies' bubbles and red reach, the leeches' eyes, Mother's eyes, head and hand shadow, the Lurker's eyes, its lane and dash, the wisps, Planny with the ring of his light (the leeches' line, red when the oil is low) and the boat's beacon; the HUD band (shrine flames, the hint line, the oil bar with its flare ticks); no random numbers, everything from a hash and the clock |
public/activities/ghoul-rush/rides/lantern/ghoul-sfx-lantern.js |
The Drowned Lantern's own sounds as data (no imports): LANTERN_SFX with tones (ghoulLantern<Act>: a creak per step on wood, the flare, the shrine, a cue per hunter heard before it reaches you, Mother's wake, rise, hand and slam), hums (ghoulLanternLurk, ghoulLanternMother, asked for through lanternHums) and music (ghoulLanternTheme, the picked Tiptoe plucks track, named in ROOM_MUSIC); first drafts until the vote; merged by ghoul-sfx.js via STAGE_SFX |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride.js |
The Carnival's dark ride (a bonus round) as a pack (RIDE), the rules ported from prototypes/ghoul-rush-ride/gallery.html. Pack fields ride (returns true, so Planny never walks; steps the ride in 16 ms steps), place (makes round.gallery, the ride's state) and a new pointer (the mouse, handed on by ghoul.js's pointer(type, x, y)); the entities (K: pop, lant, axe, chand, door, hand, head, eyes, boss, inno, mir, web, mini), hit tests with aim assist, the duck zone, hearts through kit.lose, the grade (5 to 9 dice, perf.dice). Events ride<Name> (SOUNDS), causes CAUSES. Its own seeded random stream; draws no Math.random |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-scenes.js |
The dark ride's scene table as data (12 rooms, lengths, speeds, spawn rows in author coordinates), no imports |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-core.js |
The ride's shared basics: the 96 by 54 field's constants, math helpers, the bound state G (a live import), rnd/rand (seeded) and vrand (visual) |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-draw.js |
The ride's art entry (rideArt(d, die): field(ctx, v) draws the whole field by phase, tick the cascade's sounds); ghoul-draw.js hands over to it when round.gallery is set. Parts: ghoul-ride-gfx.js (canvas helpers), ghoul-ride-draw-kinds.js (animatronics, mini-bosses, the Barker), ghoul-ride-draw-sets.js (the 12 sets, far walls, aisle, near layer), ghoul-ride-draw-hud.js (car and Planny, HUD, duck strip, reticle, title, end cascade) |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-gfx.js |
The ride's drawing helpers: the bound 2D context and the short fill, stroke and shape calls the ride's art is written in |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-draw-kinds.js |
The ride's drawn things: every figure, beast, lantern, blade, door, hand, head, mirror, web and boss, a port of the prototype's draw code (prototypes/ghoul-rush-ride/gallery.html) |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-draw-sets.js |
The ride's rooms drawn: each room's far wall, set pieces front and back, aisle and the near pillars, a port of the prototype's world draw |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-draw-hud.js |
The ride's car and the screen around it: Planny in his car, blood and sparks, the lens, the hearts, the progress bar, the room plaque, the aim, the title and the cleared card |
public/activities/ghoul-rush/rides/dark-ride/ghoul-ride-voices.js |
The ride's LOOKS, VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS and react (every ride<Name> event plays tone ghoulRide<Name>) |
public/activities/ghoul-rush/rides/dark-ride/ghoul-sfx-ride.js |
The ride's synthesized sounds as tones (ghoulRide<Kind>) and its music ghoulRideDrone (RIDE_SFX, merged by ghoul-sfx.js) |
public/activities/ghoul-rush/rides/sled/ghoul-sled.js |
The Coffin Sled (the Frozen Lake's bonus round) as a pack (SLED), modeled on the Runaway Cart (ghoul-cart.js): pack fields ride, place and target; the track of ice lines with cracks, headstones, drifts, low branches, hands, icicles and popping ghouls, checkpoints, hearts through the Cart's bonus machinery and the grade (3 to 9 dice). Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header |
public/activities/ghoul-rush/rides/hearse/ghoul-hearse.js |
The Midnight Hearse (the Graveyard's bonus round) as a pack (HEARSE), modeled on the Coffin Sled: pack fields ride, place and target; state in round.runner (id: "hearse"); a flat road of two lanes (road and verge) switched with LEFT/RIGHT inside the lane gates, open graves, headstones and crosses to jump, low branches and the lychgate arch to duck, hands and crows to shoot, closed stretches to go round, lanterns that keep the lamp lit (an unbroken lamp is the grade's steady die), and coffins thrown out by each hit with a ghoul to shoot in each. Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header |
public/activities/ghoul-rush/rides/hearse/ghoul-hearse-draw.js |
The Midnight Hearse's art: LOOKS (pack: "hearse"), VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS, telegraphMarks/telegraphs (JUMP, DUCK, SHOOT and SWITCH glyphs for the hearse's lane) and hearseArt(d) (sky, hills, cemetery, road, verge, things and the hearse by moving; the cab door, lows, fog, glyphs and lamp gauge by front; dim when the lamp is out); no random numbers. Its header lists what the art reads off the rules |
public/activities/ghoul-rush/rides/sled/ghoul-sled-draw.js |
The Coffin Sled's art: LOOKS, VOICES (borrowed tones), EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS and sledArt(d) (the sky, hills, ice and things by moving, the lid, the lows and foreground flakes by front); no random numbers. Its header lists what the art reads off the rules |
public/activities/ghoul-rush/rides/gurney/ghoul-gurney.js |
Code Blue (Blackmoor Sanatorium's bonus round) as a pack (GURNEY), modeled on the Coffin Sled: pack fields ride, place and target; the gurney along ride.track (shafts are the gaps), wheelchairs that roll, IV stands, lamps and doors overhead, orderlies in doorways, the lights-out waves (lightsAt), the surge lamps and the heartbeat monitor's beat; its state is round.runner (pack: "codeblue", put back if another pack's place clears the shared slot); draws no random number; imports the cart's track helpers |
public/activities/ghoul-rush/rides/gurney/ghoul-gurney-draw.js |
Code Blue's art: LOOKS, VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS, telegraphMarks/telegraphs and gurneyArt(d) (the corridors, shafts and floors by moving; the gurney, lows, glyphs, countdown and monitor by front; dim and lights for the blackouts); no imports but the Sled's glyph colors |
public/activities/ghoul-rush/rides/mower/ghoul-mower.js |
The Gardener's Revenge (the Grounds' bonus round) as a pack (MOWER), modeled on the Coffin Sled: pack fields ride, place and target; state in the shared round.runner slot (id mower); a flat lawn run on a ride-on mower with gaps (ponds, ha-ha ditches), junk, hedge arches, clothes lines of gloves and snapping topiary beasts, and the twist: holding fire lowers the blades, which cut tall grass, weeds and thorn hedges in the zone ahead (the blades heat and jam, so they are pulsed); the lawn-cut share is the grade's steady die; hearts through the Cart's bonus machinery; no random numbers |
public/activities/ghoul-rush/rides/mower/ghoul-mower-draw.js |
The Gardener's Revenge's art: LOOKS, VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS, telegraphMarks/telegraphs (JUMP, DUCK and CUT glyphs) and mowerArt(d) (sky, manor, topiary and railings by moving, the lawn with its ponds and ditches, the mower with its blades and heat gauge, the lows and the lawn gauge by front); no random numbers |
public/activities/ghoul-rush/rides/mower/ghoul-sfx-mower.js |
The Gardener's Revenge's own sounds as data (no imports): MOWER_SFX with first-draft tones (ghoulMower<Act>, each under 1.2 s) and the ghoulMowerRide track (sound and music picks still pending); merged by ghoul-sfx.js via STAGE_SFX, the track set in ROOM_MUSIC |
public/activities/ghoul-rush/rides/pew/ghoul-pew.js |
Holy Roller (the Chapel's bonus round) as a pack (PEW): a Subway-Surfers style endless-runner seen from behind, pack fields ride, place and target; state in the shared round.runner slot (id pew). you.x is only the distance run; the pew's own lane (a float to laneTo), h, slide, combo and magnet live in round.runner. Left/right presses change lane (a wall bump at the edge), up jumps, down slides (fast-fall in the air), fire shoots down the lane; a speed ramp by distance (speedAt); KINDS (switch: pillar, confessional, pewx; jump: kneeler, stand, cracks, hatch; slide: censer, banner, beam; shoot: garg with 2 hp, bell rope), wax souls and halos, the combo and the steady die (souls share); a hit shoves the pew to a calm lane. Pure rules, no random numbers |
public/activities/ghoul-rush/rides/pew/ghoul-pew-course.js |
Holy Roller's seeded course (no imports): written in seconds and laid by the speed ramp (xAt, speedAt, V0, ACC), COURSE { items [x, lane, kind, len], souls, checks, finish } |
public/activities/ghoul-rush/rides/pew/ghoul-pew-draw.js |
Holy Roller's art: LOOKS, VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS and pewArt(d), whose field(ctx, view) draws the WHOLE field (ghoul-draw.js has a round.runner.id === "pew" branch like the dark ride's round.gallery one, then adds the hearts, flash, banner, cards and HUD pills) plus the progress track, souls and combo strip, and the events' effects |
public/activities/ghoul-rush/rides/pew/ghoul-pew-world.js |
Holy Roller's pseudo-3D nave: worldArt(d) with paint(ctx, view); the projection (lane, depth, height) to the screen with scale = near / (near + depth) toward a vanishing point, far-to-near cells with fog as alpha, stained glass, pillars and ribs, pews, candlelight and god rays pulsing on the organ's beat (pulse, BPM), every thing's art and telegraph glyph, the souls, bolts, the pew and hero from behind, speed streaks and vignette. A reusable pattern for "run into the screen" rides. No random numbers (hashes) |
public/activities/ghoul-rush/rides/pew/ghoul-sfx-pew.js |
Holy Roller's own sounds as data (no imports): PEW_SFX with 17 tones (lane, bump, jump, land, slide, dive, soul, halo, crash, check, finish, speed swell, gargoyle and bell) and the driving ghoulPewDirge track at 132 BPM (first drafts, merged by ghoul-sfx.js) |
public/activities/ghoul-rush/rides/hearse/ghoul-sfx-hearse.js |
The Midnight Hearse's own sounds as data (no imports): HEARSE_SFX with 19 first-draft ghoulHearse<Act> tones (none over 1.2 s) and the ghoulHearseRide track (a funeral march at a gallop, built from three four-bar parts); merged by ghoul-sfx.js, named in ROOM_MUSIC. Sounds and music still to be picked by ear |
public/activities/ghoul-rush/rides/sled/ghoul-sfx-sled.js |
The Coffin Sled's own sounds as data (no imports): SLED_SFX with an empty tones and music until the user picks them; merged by ghoul-sfx.js (the room plays the Graveyard's ghoulGraves) |
public/activities/ghoul-rush/rides/banister/ghoul-banister.js |
The Grand Banister (the Manor's bonus round) as a pack (BANISTER), modeled on the Coffin Sled: pack fields ride, place and target; state in the shared round.runner slot (id banister); YOU slide down a grand staircase's banister along ride.track (the first rails lines are the handrail, the breaks between them gaps to jump; the rest are brass under-rails beside it, the split track: a jump with DOWN held dives onto one, a jump off its end lands back on the handrail), vases and candlesticks to jump, hanging portrait frames to duck, chandeliers on a pendulum (swingAt: a wall from the bob to the roof, lethal to a ducking rider while the bob is mid-swing, so you brake or lean (LEFT/RIGHT) to time them or take the under-rail), ghostly butlers that lunge (jump or two bolts) and cobwebs to shoot. Adds no monster, boss or hazard kind; no random numbers. Its header documents the room fields |
public/activities/ghoul-rush/rides/banister/ghoul-banister-draw.js |
The Grand Banister's art: LOOKS (pack: "banister"), VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS, telegraphMarks/telegraphs (JUMP, DUCK and DIVE glyphs) and banisterArt(d) (damask wall, moonlit windows, a zig-zag of staircase flights, portraits whose eyes follow YOU, the rails, props, butlers and webs by moving; the hanging frames, the chandeliers with the arc they swing through, sparks and glyphs by front); no random numbers. Its header lists what the art reads off the rules |
public/activities/ghoul-rush/rides/banister/ghoul-sfx-banister.js |
The Grand Banister's own sounds as data (no imports): BANISTER_SFX with 14 first-draft ghoulBan<Act> tones (each under 1.2 s) and the ghoulBanister track (a harpsichord waltz at a gallop, built from three four-bar parts); merged by ghoul-sfx.js via STAGE_SFX, named in ROOM_MUSIC (sound and music picks still pending) |
public/activities/ghoul-rush/rides/wagon/ghoul-wagon.js |
The Torch Mob (Hollow End Village's bonus round) as a pack (WAGON), modeled on the Coffin Sled: pack fields ride, place and target; a hay wagon along ride.track (ditches and the collapsed bridge are the gaps, a rising line end a ramp), barrels and crates, washing lines and inn signs, villagers who hurl pitchforks (duck) and torches (jump), spooked horses, and the pursuit meter (gap: the mob runs at MOB_V, DOWN is a duck and the brake, a hit, a burning hay load and the surge close it, a shot torch or fork opens it, inside PANIC_ON the horses bolt, at CATCH_GAP it is a heart); its state is round.runner (id: "wagon"); draws no random number; imports the cart's track helpers |
public/activities/ghoul-rush/rides/wagon/ghoul-wagon-draw.js |
The Torch Mob's art: LOOKS (pack: "wagon"), VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS, telegraphMarks/telegraphs and wagonArt(d) (the sky, rooftops, street, cobbled road, ditches, the bridge and river, the things, the mob and the wagon by moving; the lows, throws in the air, the hay fire, glyphs and the mob's meter by front); no random numbers; imports the Sled's glyph colors and the rules' constants |
public/activities/ghoul-rush/rides/wagon/ghoul-sfx-wagon.js |
The Torch Mob's own sounds as data (no imports): WAGON_SFX with 18 first-sketch ghoulWagon<Act> tones and the ghoulWagonRide track (a D minor gallop built from three 4-bar patterns); merged by ghoul-sfx.js, the room's track named in ROOM_MUSIC (wagon) |
public/activities/ghoul-rush/rides/gurney/ghoul-sfx-gurney.js |
Code Blue's own sounds as data (no imports): GURNEY_SFX, 18 first-pick ghoulBlue<Act> tones and the track ghoulBlueRide; merged by ghoul-sfx.js (the room plays it via ROOM_MUSIC.codeblue) |
public/activities/ghoul-rush/rides/tray/ghoul-tray.js |
The Servants' Back Stairs (the East Wing's bonus round) as a pack (TRAY), modeled on the Coffin Sled: pack fields ride, place and target; the track of shelves and stair flights with gaps, rolling pots and cutlery, hams and pans, cooks who fling dishes, the courses (silver domes and flying plates, seven is the grade's acts die), the cherries, grease stretches, checkpoints and the grade (3 to 9 dice). State is round.runner (id tray), the shared slot for a rolling bonus ride. Adds no monster, boss or hazard kind and draws no random number; every number is an exported constant documented in its header |
public/activities/ghoul-rush/rides/tray/ghoul-tray-draw.js |
The Servants' Back Stairs' art: LOOKS, VOICES, EVENT_VOICE, LOSE_WORDS, LOSE_SOUNDS, the telegraph glyphs (telegraphMarks, telegraphs: JUMP, DUCK, SHOOT) and trayArt(d) (the kitchen, shelves and stairs, things and cooks by moving; the tray, hams and pans, flour and glyphs by front); no random numbers |
public/activities/ghoul-rush/rides/tray/ghoul-sfx-tray.js |
The Servants' Back Stairs' sounds and music as data (no imports): TRAY_SFX with 13 first-draft tones and the ghoulTrayRide track; merged by ghoul-sfx.js |