Skip to content

feat(#215): debris particles behind the rock, and a jump that moves it#216

Open
cnotv wants to merge 1 commit into
mainfrom
feat/rock-runner-debris
Open

feat(#215): debris particles behind the rock, and a jump that moves it#216
cnotv wants to merge 1 commit into
mainfrom
feat/rock-runner-debris

Conversation

@cnotv

@cnotv cnotv commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Closes #215

Summary

Debris kicked up behind the rock while it is grounded and moving, and a fix for the jump, which was firing all along but moving the rock nine centimetres.

Key Changes

Debris

New game/debris.ts. Chips are thrown from just forward of the rock's contact patch and immediately left behind, so they read as scuffed off the ground rather than falling out of the ball.

  • Pooled — a fixed set of particles recycled oldest-first, so a long run never allocates or collects. With a full pool the longest-lived chip is the one already fading, so reuse is invisible.
  • Stroke at one extra draw call — the chips draw in one instanced mesh and a slightly larger copy drawn back-faces-only reads as an ink outline around each, rather than an outline mesh per particle.
  • Coloured like the ground or the rock, tinted per instance.
  • Emission is paced by an interval and released in bursts, because at 23 m/s the rock outruns a single chip per tick.
  • Chips shrink away at the end of their life rather than blinking out.

Jump

JUMP_IMPULSE was still tuned for the rock's old mass. An impulse is momentum, so it has to grow with the mass: at 95 against a mass of 72 the rock launched at 1.3 m/s and rose nine centimetres — indistinguishable from nothing happening. It now clears roughly its own height.

Contact tolerance

Debris judges ground contact with more room than the jump does. The rock leaves the deck briefly over every crest, and sharing the jump's stricter probe made the trail flicker.

Added on top of the initial plan

  • The debris colours needed their own constants. They were first taken from ROCK_TINT, which is the multiplier applied over a dark albedo — on its own a pale peach. Both palette colours were then pale sand on a pale sand path and the chips were invisible even while the pool reported them alive. The rock's apparent colour is now its own constant.
  • Chips start forward of the contact patch rather than behind it. Spawned behind, they fall out of the chase camera's view almost immediately at running speed.
  • The emitter is a module-level factory rather than part of the actions factory, which had grown past its line limit.

Test Plan

  • pnpm test:unit1729 passed, 22 of them new: particle integration under gravity, lifetime and fade, launch direction and spread, the two-mesh structure and back-face stroke, pooling under sustained emission, and emission pacing.
  • pnpm lint — 0 errors. pnpm type-check — clean.
  • Manual, driven with Playwright: chips appear behind the rock with their outline while grounded and moving, and the rock visibly leaves the ground on space, its shadow separating beneath it.

🤖 Generated with Claude Code

Chips are thrown from just forward of the rock's contact patch whenever
it is on the ground and moving, then immediately left behind. They are
pooled: a fixed set is recycled oldest-first, so a long run never
allocates. The whole trail draws in two instanced meshes — the chips, and
a slightly larger copy drawn back-faces-only that reads as an ink outline
around each one — so the hand-drawn stroke costs one extra draw call
rather than one per particle.

Their colours are the path and the rock. Not the rock's tint, which is
the multiplier applied over a dark albedo and on its own is a pale peach
that disappears against the path; the rock's apparent colour is its own
constant.

The jump was firing all along and moving the rock nine centimetres. An
impulse is momentum, so it has to grow with the mass, and tripling the
rock to 72 had left the old figure launching it at 1.3 m/s. It now clears
roughly its own height.

Contact for debris is judged with more room than the jump's, because the
rock leaves the deck briefly over every crest and the trail flickered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploy Preview for cnotv-generative-art ready!

Name Link
🔨 Latest commit 1ce5316
🔍 Latest deploy log https://app.netlify.com/projects/cnotv-generative-art/deploys/6a666de3ad370f0008cb0d7b
😎 Deploy Preview https://deploy-preview-216--cnotv-generative-art.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RockRunner: debris particles behind the rock, and a jump that moves it

1 participant