Skip to content

[1/3] feat: add the anomaly image cut, pixel stretch and 404 void - #118

Merged
arudaev merged 1 commit into
mainfrom
feature/37-anomaly-fx
Oct 23, 2026
Merged

arudaev merged 1 commit into
mainfrom
feature/37-anomaly-fx

Conversation

@arudaev

@arudaev arudaev commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What and why

The anomaly language from docs/06, as three effects that go on top of any stage layer:

  • Image cut – addImageCut(layer, area, shift, copies): the area shifted sideways and repeated.
  • Pixel stretch – addPixelStretch(layer, area, row): one row smeared down the area into vertical streaks.
  • 404 void – add404Void(layer, area, seed): flat grey with torn edges and the broken-image icon.

Cheap: every effect is built once – cropped copies of the layer's own texture (same position, scroll factor and depth) or one static Graphics – so nothing redraws per frame. The geometry lives in fx/anomalyLayout.ts (pure, Vitest-tested); fx/anomaly.ts turns it into game objects.

Test chunk: in dev builds, F9 (from the HUD) opens AnomalyTest: the first Rusty Creek chunk with each effect on it; V shows and hides them, arrows pan, Esc closes. It is registered only when import.meta.env.DEV, so production doesn't ship it.

The story (#54: the creek turns) and the stage loader (#116) will call these on the anomaly chunks; areas are in layer texture pixels.

Verification

  • npm run typecheck, npm test (18 passing, 4 new), npm run build; production bundle has no AnomalyTest.
  • Dev server: F9 shows all three effects on rc-0-0; V toggles them; no console errors.
  • Frame time: not measured with a profiler – the effects add 5 static objects.

Issue

Closes #37

Stack

Merge bottom up.

Each effect is built once from cropped copies of a stage layer's own texture, or one static drawing for the void, so nothing redraws per frame. Dev builds open a test chunk with F9; V toggles the effects.
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
wincs Ready Ready Preview Oct 23, 2026 9:22pm UTC

Request Review

@arudaev arudaev self-assigned this Oct 23, 2026
@github-actions github-actions Bot added the area:ui HUD, crash window, title, menus label Oct 23, 2026
@arudaev
arudaev marked this pull request as ready for review October 23, 2026 21:23
@arudaev arudaev changed the title feat: add the anomaly image cut, pixel stretch and 404 void [1/2] feat: add the anomaly image cut, pixel stretch and 404 void Oct 23, 2026
@arudaev arudaev changed the title [1/2] feat: add the anomaly image cut, pixel stretch and 404 void [1/3] feat: add the anomaly image cut, pixel stretch and 404 void Oct 23, 2026
@arudaev
arudaev merged commit c4b8ad4 into main Oct 23, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui HUD, crash window, title, menus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M5-S5] Anomaly FX: image cuts, stretched pixels, 404 voids

1 participant