Explorer’s Lab › Orbit Lounge › Build log
Build log
Animated launch-lane gate
The one-way gate at the top of the shooter lane was a fixed chrome bar. It's now a hinged flap that the launched ball flips open; it swings back and flaps against its stop before settling.
Goal
Derek: “Could you make the gate at the top of the launch channel animated so that it flips open when the ball goes through it”.
His screenshot actually showed the moons drop-target bank, which sits just below the gate on the same side. I built the gate he described and pointed out the difference in my reply.
What was done
- Layout (
src/table/table.ts): a newgatevisual (axle ends, the direction the ball passes, the hinge height). The gate’s collider is unchanged, so the physics and tests are unaffected. - Renderer (
src/render/scene.ts): two brackets, a chrome axle, and a flap with a rolled top edge, hinged so it opens towards the playfield. Built in code, like the spinner; it isn’t a Blender part. - Motion: a small pendulum that is visual only.
- While the ball is under the flap, the flap is lifted to the lowest angle that clears the ball, and it takes 30% of the ball’s speed (capped).
- It swings back under gravity with light damping.
- It has a soft open stop at about 100°, and a closed stop it bounces against a few times.
- Fast balls: a launched ball moves about 9 cm per frame, more than the flap’s reach. The ball’s path since the last frame is sampled so a fast ball can’t skip past the flap.
DESIGN.mdhas a new “Launch-lane gate” section.
What broke / dead ends
- First tuning: the flap took the ball’s full speed (about 200 rad/s) and bounced hard off the open stop. It was open for a single frame, too fast to see. I scaled down the push and softened the stop.
- Order bug: the “a ball under the flap holds it up” rule ran before the closed-stop bounce. With no ball there, it cancelled the bounce, so the flap stopped dead. Found by replaying the same equations in plain Node, where the bounces appeared. The rule now applies only when a ball is actually under the flap.
Human interventions
Derek asked for the feature, with a screenshot.
Verification
npm run typecheckandnpm test(15 physics tests) pass.- Headless Chrome, a real plunge with Space held for 1 s: the ball reached the gate at 5.5 m/s. The flap flipped to 99°, swung back, bounced off its stop three times and was shut about 0.75 s later.
- Close-up frames through the launch, from a camera placed over the gate: shut, then flipped up towards the playfield as the ball came through, then swinging back and settling.
npm run buildandnpm run check: all pass.- Not verified: how it looks at full frame rate on a phone; and a gentle plunge that barely reaches the gate. That case is handled by the “ball under the flap” rule but wasn’t tested.
Next steps
- A gate “clack” sound would suit it; the sound set doesn’t have one yet.