BlueGit

projects-timfalken-com meteors

t1183: docs (NL) and build

timfa Grok Bot · pushed by timfa

Authored 2026-11-14 · 3 days ago

Hash
68ebb2787969d871348ec67fe4f35dfade0bfd89
Parent
a06352da
3 files changed +213 −5
README.md +9 −0
@@ -196,6 +196,15 @@ op een stapel weer een kleur krijgt. Wie al zijn kolommen vol heeft, is toeschou
196 196 en geen doelwit meer. De laatste die overblijft wint; 1e/2e/3e staan 5 seconden
197 197 op het podium en daarna ga je terug naar de lobby.
198 198
199 ### Raketvlam
200
201 De vlam onder een raketblok wisselt 25 keer per seconde naar een willekeurig
202 ander frame, spiegelt in de helft van de gevallen en varieert licht in
203 grootte, breedte, hoogte (elk ±6–7%) en hoek (±2,5°). Alles draait om het
204 bovenste midden van de vlam, waar hij aan het blok vastzit. Met
205 "verminderde beweging" (prefers-reduced-motion) blijft het bij 12,5 fps en
206 alleen wisselende frames.
207
199 208 ### Vliegende blokken en mini-velden (vloeiend)
200 209
201 210 - Een blok dat je wegschiet vliegt **meteen** lokaal weg (geen wachten op de
@@ -196,6 +196,15 @@ op een stapel weer een kleur krijgt. Wie al zijn kolommen vol heeft, is toeschou
196en geen doelwit meer. De laatste die overblijft wint; 1e/2e/3e staan 5 seconden
196en geen doelwit meer. De laatste die overblijft wint; 1e/2e/3e staan 5 seconden
197op het podium en daarna ga je terug naar de lobby.
197op het podium en daarna ga je terug naar de lobby.
198
198
199### Raketvlam
200
201De vlam onder een raketblok wisselt 25 keer per seconde naar een willekeurig
202ander frame, spiegelt in de helft van de gevallen en varieert licht in
203grootte, breedte, hoogte (elk ±6–7%) en hoek (±2,5°). Alles draait om het
204bovenste midden van de vlam, waar hij aan het blok vastzit. Met
205"verminderde beweging" (prefers-reduced-motion) blijft het bij 12,5 fps en
206alleen wisselende frames.
207
199### Vliegende blokken en mini-velden (vloeiend)
208### Vliegende blokken en mini-velden (vloeiend)
200
209
201- Een blok dat je wegschiet vliegt **meteen** lokaal weg (geen wachten op de
210- Een blok dat je wegschiet vliegt **meteen** lokaal weg (geen wachten op de
build/game.js +177 −5
@@ -8180,6 +8180,163 @@ else if (typeof globalThis !== 'undefined')
8180 8180 * /workspace/meteors/src/gameCore.js
8181 8181 */
8182 8182
8183 /*
8184 * Start File:
8185 * /workspace/meteors/src/flameFx.js
8186 */
8187 /**
8188 * t1183 — rocket flame jitter.
8189 *
8190 * Every animation tick (FPS ticks per second) the flame picks a random
8191 * sprite frame (different from the current one), flips horizontally with
8192 * 50% chance and gets a small random scale / width / height / rotation.
8193 * All of it pivots on the top-centre of the flame, where it attaches to
8194 * the block, so that point never moves.
8195 *
8196 * Purely visual. Pure functions so it can be unit-tested.
8197 */
8198 var FlameFx = {};
8199
8200 /** Ticks per second (was 12.5 fps = 0.08 s per frame; doubled). */
8201 FlameFx.FPS = 25;
8202 /** Reduced motion: old frame rate, no flip/scale/rotation jitter. */
8203 FlameFx.REDUCED_FPS = 12.5;
8204 /** Overall scale variation (±). */
8205 FlameFx.SCALE_VAR = 0.06;
8206 /** Extra independent width variation (±). */
8207 FlameFx.WIDTH_VAR = 0.07;
8208 /** Extra independent height variation (±). */
8209 FlameFx.HEIGHT_VAR = 0.07;
8210 /** Rotation variation in degrees (±). */
8211 FlameFx.ROT_VAR_DEG = 2.5;
8212
8213 FlameFx.reducedMotion = function ()
8214 {
8215 try
8216 {
8217 var w = typeof window !== 'undefined' ? window : null;
8218 return !!(w && w.matchMedia && w.matchMedia('(prefers-reduced-motion: reduce)').matches);
8219 }
8220 catch (e)
8221 { return false; }
8222 };
8223
8224 /** New per-flame state; the phase is random so flames don't tick in sync. */
8225 FlameFx.create = function (frames, rand, reduced)
8226 {
8227 rand = rand || Math.random;
8228 var st = { frame: 0, timer: 0, flip: false, scale: 1, w: 1, h: 1, rot: 0, frames: frames || 1 };
8229 st.timer = rand() / FlameFx.FPS;
8230 FlameFx.roll(st, rand, !!reduced);
8231 return st;
8232 };
8233
8234 /** Random frame index in [0, frames), different from `current` when possible. */
8235 FlameFx.pickFrame = function (current, frames, rand)
8236 {
8237 rand = rand || Math.random;
8238 if (frames <= 1)
8239 { return 0; }
8240 // Choose among the other frames-1 indices uniformly.
8241 var k = Math.floor(rand() * (frames - 1));
8242 if (k >= frames - 1)
8243 { k = frames - 2; }
8244 return k >= current ? k + 1 : k;
8245 };
8246
8247 function flameVar (rand, amount)
8248 {
8249 return 1 + (rand() * 2 - 1) * amount;
8250 }
8251
8252 /** One animation tick: new frame, flip, scales and rotation. */
8253 FlameFx.roll = function (st, rand, reduced)
8254 {
8255 rand = rand || Math.random;
8256 st.frame = FlameFx.pickFrame(st.frame, st.frames, rand);
8257 if (reduced)
8258 {
8259 st.flip = false;
8260 st.scale = 1;
8261 st.w = 1;
8262 st.h = 1;
8263 st.rot = 0;
8264 return st;
8265 }
8266 st.flip = rand() < 0.5;
8267 st.scale = flameVar(rand, FlameFx.SCALE_VAR);
8268 st.w = flameVar(rand, FlameFx.WIDTH_VAR);
8269 st.h = flameVar(rand, FlameFx.HEIGHT_VAR);
8270 st.rot = (rand() * 2 - 1) * FlameFx.ROT_VAR_DEG;
8271 return st;
8272 };
8273
8274 /** Advance time (seconds). Returns the number of ticks that happened. */
8275 FlameFx.advance = function (st, dt, rand, reduced)
8276 {
8277 var period = 1 / (reduced ? FlameFx.REDUCED_FPS : FlameFx.FPS);
8278 st.timer += Math.max(0, dt || 0);
8279 var ticks = 0;
8280 while (st.timer >= period - 1e-9)
8281 {
8282 st.timer = Math.max(0, st.timer - period);
8283 ticks++;
8284 }
8285 // Long stall: one roll is enough, don't loop the RNG for nothing.
8286 if (ticks > 0)
8287 { FlameFx.roll(st, rand, reduced); }
8288 return ticks;
8289 };
8290
8291 /**
8292 * Draw pose for a flame whose top-centre anchor is (ax, ay) and whose
8293 * nominal size is baseW × baseH. The framework draws sprites centred on
8294 * (x, y), rotated by `rotation` degrees (clockwise, canvas y-down) around
8295 * that centre, and mirrorX flips around the vertical centre line. The
8296 * centre is placed so the rotated, scaled top-centre lands exactly on
8297 * the anchor.
8298 */
8299 FlameFx.pose = function (st, ax, ay, baseW, baseH)
8300 {
8301 var w = baseW * st.scale * st.w;
8302 var h = baseH * st.scale * st.h;
8303 var rad = st.rot * Math.PI / 180;
8304 return {
8305 x: ax - Math.sin(rad) * h / 2,
8306 y: ay + Math.cos(rad) * h / 2,
8307 w: w,
8308 h: h,
8309 rotation: st.rot,
8310 mirrorX: !!st.flip,
8311 frame: st.frame
8312 };
8313 };
8314
8315 /**
8316 * Where the top-centre of the drawn quad ends up for a pose — same
8317 * transform as the framework's sprite matrix (model point (0, -0.5)).
8318 * Used by tests to prove the anchor never moves.
8319 */
8320 FlameFx.topCentreOf = function (pose)
8321 {
8322 var rad = pose.rotation * Math.PI / 180;
8323 var c = Math.cos(rad);
8324 var s = Math.sin(rad);
8325 var sy = pose.h;
8326 // x' = c*sx*u - s*sy*v + x ; y' = s*sx*u + c*sy*v + y with u = 0, v = -0.5
8327 return { x: pose.x + s * sy * 0.5, y: pose.y - c * sy * 0.5 };
8328 };
8329
8330 if (typeof globalThis !== 'undefined')
8331 { globalThis.FlameFx = FlameFx; }
8332 if (typeof module !== 'undefined' && module.exports)
8333 { module.exports = FlameFx; }
8334
8335 /*
8336 * End File:
8337 * /workspace/meteors/src/flameFx.js
8338 */
8339
8183 8340 /*
8184 8341 * Start File:
8185 8342 * /workspace/meteors/src/miniLayout.js
@@ -13280,6 +13437,13 @@ function spriteFor (block)
13280 13437 return game.images[key] || game.images.gray;
13281 13438 }
13282 13439
13440 /** Frames in the flame sprite (from the loaded image, default 4). */
13441 function flameFrameCount ()
13442 {
13443 var img = typeof game !== 'undefined' && game.images ? game.images.flame : null;
13444 return img && img.subImages ? img.subImages : 4;
13445 }
13446
13283 13447 function syncSprites (dt)
13284 13448 {
13285 13449 if (!app.core || !app.scene)
@@ -13317,22 +13481,30 @@ function syncSprites (dt)
13317 13481 if (!flame)
13318 13482 {
13319 13483 flame = new GameObject(0, 0, game.images.flame, 1);
13320 flame.renderer.setAnimation('burn', 0, 0.08);
13484 // t1183: frames are chosen by FlameFx, not the framework cycle.
13485 flame.fx = FlameFx.create(flameFrameCount(), Math.random, FlameFx.reducedMotion());
13486 flame.renderer.setSubImage(flame.fx.frame);
13321 13487 app.scene.addObject(flame);
13322 13488 app.flames[block.id] = flame;
13323 13489 }
13324 13490 flame.renderer.visible = true;
13491 FlameFx.advance(flame.fx, dt, Math.random, FlameFx.reducedMotion());
13325 13492 var t = app.tile;
13326 13493 // 3x as large (length and width, t1110). Keep the top of the
13327 13494 // flame at the same overlap into the block so the extra length
13328 // extends downward under the rocket.
13495 // extends downward under the rocket. t1183: random frame, flip,
13496 // scale and rotation all pivot on that top-centre anchor.
13329 13497 var flameW = t * 0.85 * 3;
13330 13498 var flameH = t * 0.85 * 3;
13331 13499 var origCenter = app.fieldH - block.y * t + t * 0.15;
13332 13500 var origTop = origCenter - (t * 0.85) / 2;
13333 flame.transform.position.x = block.col * t + t / 2;
13334 flame.transform.position.y = origTop + flameH / 2;
13335 flame.transform.size = { x: flameW, y: flameH };
13501 var pose = FlameFx.pose(flame.fx, block.col * t + t / 2, origTop, flameW, flameH);
13502 flame.renderer.subImage = pose.frame;
13503 flame.renderer.mirrorX = pose.mirrorX;
13504 flame.transform.rotation = pose.rotation;
13505 flame.transform.position.x = pose.x;
13506 flame.transform.position.y = pose.y;
13507 flame.transform.size = { x: pose.w, y: pose.h };
13336 13508 }
13337 13509 else if (app.flames[block.id])
13338 13510 { app.flames[block.id].renderer.visible = false; }
@@ -8180,6 +8180,163 @@ else if (typeof globalThis !== 'undefined')
8180 * /workspace/meteors/src/gameCore.js
8180 * /workspace/meteors/src/gameCore.js
8181 */
8181 */
8182
8182
8183/*
8184 * Start File:
8185 * /workspace/meteors/src/flameFx.js
8186 */
8187/**
8188 * t1183 — rocket flame jitter.
8189 *
8190 * Every animation tick (FPS ticks per second) the flame picks a random
8191 * sprite frame (different from the current one), flips horizontally with
8192 * 50% chance and gets a small random scale / width / height / rotation.
8193 * All of it pivots on the top-centre of the flame, where it attaches to
8194 * the block, so that point never moves.
8195 *
8196 * Purely visual. Pure functions so it can be unit-tested.
8197 */
8198var FlameFx = {};
8199
8200/** Ticks per second (was 12.5 fps = 0.08 s per frame; doubled). */
8201FlameFx.FPS = 25;
8202/** Reduced motion: old frame rate, no flip/scale/rotation jitter. */
8203FlameFx.REDUCED_FPS = 12.5;
8204/** Overall scale variation (±). */
8205FlameFx.SCALE_VAR = 0.06;
8206/** Extra independent width variation (±). */
8207FlameFx.WIDTH_VAR = 0.07;
8208/** Extra independent height variation (±). */
8209FlameFx.HEIGHT_VAR = 0.07;
8210/** Rotation variation in degrees (±). */
8211FlameFx.ROT_VAR_DEG = 2.5;
8212
8213FlameFx.reducedMotion = function ()
8214{
8215 try
8216 {
8217 var w = typeof window !== 'undefined' ? window : null;
8218 return !!(w && w.matchMedia && w.matchMedia('(prefers-reduced-motion: reduce)').matches);
8219 }
8220 catch (e)
8221 { return false; }
8222};
8223
8224/** New per-flame state; the phase is random so flames don't tick in sync. */
8225FlameFx.create = function (frames, rand, reduced)
8226{
8227 rand = rand || Math.random;
8228 var st = { frame: 0, timer: 0, flip: false, scale: 1, w: 1, h: 1, rot: 0, frames: frames || 1 };
8229 st.timer = rand() / FlameFx.FPS;
8230 FlameFx.roll(st, rand, !!reduced);
8231 return st;
8232};
8233
8234/** Random frame index in [0, frames), different from `current` when possible. */
8235FlameFx.pickFrame = function (current, frames, rand)
8236{
8237 rand = rand || Math.random;
8238 if (frames <= 1)
8239 { return 0; }
8240 // Choose among the other frames-1 indices uniformly.
8241 var k = Math.floor(rand() * (frames - 1));
8242 if (k >= frames - 1)
8243 { k = frames - 2; }
8244 return k >= current ? k + 1 : k;
8245};
8246
8247function flameVar (rand, amount)
8248{
8249 return 1 + (rand() * 2 - 1) * amount;
8250}
8251
8252/** One animation tick: new frame, flip, scales and rotation. */
8253FlameFx.roll = function (st, rand, reduced)
8254{
8255 rand = rand || Math.random;
8256 st.frame = FlameFx.pickFrame(st.frame, st.frames, rand);
8257 if (reduced)
8258 {
8259 st.flip = false;
8260 st.scale = 1;
8261 st.w = 1;
8262 st.h = 1;
8263 st.rot = 0;
8264 return st;
8265 }
8266 st.flip = rand() < 0.5;
8267 st.scale = flameVar(rand, FlameFx.SCALE_VAR);
8268 st.w = flameVar(rand, FlameFx.WIDTH_VAR);
8269 st.h = flameVar(rand, FlameFx.HEIGHT_VAR);
8270 st.rot = (rand() * 2 - 1) * FlameFx.ROT_VAR_DEG;
8271 return st;
8272};
8273
8274/** Advance time (seconds). Returns the number of ticks that happened. */
8275FlameFx.advance = function (st, dt, rand, reduced)
8276{
8277 var period = 1 / (reduced ? FlameFx.REDUCED_FPS : FlameFx.FPS);
8278 st.timer += Math.max(0, dt || 0);
8279 var ticks = 0;
8280 while (st.timer >= period - 1e-9)
8281 {
8282 st.timer = Math.max(0, st.timer - period);
8283 ticks++;
8284 }
8285 // Long stall: one roll is enough, don't loop the RNG for nothing.
8286 if (ticks > 0)
8287 { FlameFx.roll(st, rand, reduced); }
8288 return ticks;
8289};
8290
8291/**
8292 * Draw pose for a flame whose top-centre anchor is (ax, ay) and whose
8293 * nominal size is baseW × baseH. The framework draws sprites centred on
8294 * (x, y), rotated by `rotation` degrees (clockwise, canvas y-down) around
8295 * that centre, and mirrorX flips around the vertical centre line. The
8296 * centre is placed so the rotated, scaled top-centre lands exactly on
8297 * the anchor.
8298 */
8299FlameFx.pose = function (st, ax, ay, baseW, baseH)
8300{
8301 var w = baseW * st.scale * st.w;
8302 var h = baseH * st.scale * st.h;
8303 var rad = st.rot * Math.PI / 180;
8304 return {
8305 x: ax - Math.sin(rad) * h / 2,
8306 y: ay + Math.cos(rad) * h / 2,
8307 w: w,
8308 h: h,
8309 rotation: st.rot,
8310 mirrorX: !!st.flip,
8311 frame: st.frame
8312 };
8313};
8314
8315/**
8316 * Where the top-centre of the drawn quad ends up for a pose — same
8317 * transform as the framework's sprite matrix (model point (0, -0.5)).
8318 * Used by tests to prove the anchor never moves.
8319 */
8320FlameFx.topCentreOf = function (pose)
8321{
8322 var rad = pose.rotation * Math.PI / 180;
8323 var c = Math.cos(rad);
8324 var s = Math.sin(rad);
8325 var sy = pose.h;
8326 // x' = c*sx*u - s*sy*v + x ; y' = s*sx*u + c*sy*v + y with u = 0, v = -0.5
8327 return { x: pose.x + s * sy * 0.5, y: pose.y - c * sy * 0.5 };
8328};
8329
8330if (typeof globalThis !== 'undefined')
8331{ globalThis.FlameFx = FlameFx; }
8332if (typeof module !== 'undefined' && module.exports)
8333{ module.exports = FlameFx; }
8334
8335/*
8336 * End File:
8337 * /workspace/meteors/src/flameFx.js
8338 */
8339
8183/*
8340/*
8184 * Start File:
8341 * Start File:
8185 * /workspace/meteors/src/miniLayout.js
8342 * /workspace/meteors/src/miniLayout.js
@@ -13280,6 +13437,13 @@ function spriteFor (block)
13280 return game.images[key] || game.images.gray;
13437 return game.images[key] || game.images.gray;
13281}
13438}
13282
13439
13440/** Frames in the flame sprite (from the loaded image, default 4). */
13441function flameFrameCount ()
13442{
13443 var img = typeof game !== 'undefined' && game.images ? game.images.flame : null;
13444 return img && img.subImages ? img.subImages : 4;
13445}
13446
13283function syncSprites (dt)
13447function syncSprites (dt)
13284{
13448{
13285 if (!app.core || !app.scene)
13449 if (!app.core || !app.scene)
@@ -13317,22 +13481,30 @@ function syncSprites (dt)
13317 if (!flame)
13481 if (!flame)
13318 {
13482 {
13319 flame = new GameObject(0, 0, game.images.flame, 1);
13483 flame = new GameObject(0, 0, game.images.flame, 1);
13320 flame.renderer.setAnimation('burn', 0, 0.08);
13484 // t1183: frames are chosen by FlameFx, not the framework cycle.
13485 flame.fx = FlameFx.create(flameFrameCount(), Math.random, FlameFx.reducedMotion());
13486 flame.renderer.setSubImage(flame.fx.frame);
13321 app.scene.addObject(flame);
13487 app.scene.addObject(flame);
13322 app.flames[block.id] = flame;
13488 app.flames[block.id] = flame;
13323 }
13489 }
13324 flame.renderer.visible = true;
13490 flame.renderer.visible = true;
13491 FlameFx.advance(flame.fx, dt, Math.random, FlameFx.reducedMotion());
13325 var t = app.tile;
13492 var t = app.tile;
13326 // 3x as large (length and width, t1110). Keep the top of the
13493 // 3x as large (length and width, t1110). Keep the top of the
13327 // flame at the same overlap into the block so the extra length
13494 // flame at the same overlap into the block so the extra length
13328 // extends downward under the rocket.
13495 // extends downward under the rocket. t1183: random frame, flip,
13496 // scale and rotation all pivot on that top-centre anchor.
13329 var flameW = t * 0.85 * 3;
13497 var flameW = t * 0.85 * 3;
13330 var flameH = t * 0.85 * 3;
13498 var flameH = t * 0.85 * 3;
13331 var origCenter = app.fieldH - block.y * t + t * 0.15;
13499 var origCenter = app.fieldH - block.y * t + t * 0.15;
13332 var origTop = origCenter - (t * 0.85) / 2;
13500 var origTop = origCenter - (t * 0.85) / 2;
13333 flame.transform.position.x = block.col * t + t / 2;
13501 var pose = FlameFx.pose(flame.fx, block.col * t + t / 2, origTop, flameW, flameH);
13334 flame.transform.position.y = origTop + flameH / 2;
13502 flame.renderer.subImage = pose.frame;
13335 flame.transform.size = { x: flameW, y: flameH };
13503 flame.renderer.mirrorX = pose.mirrorX;
13504 flame.transform.rotation = pose.rotation;
13505 flame.transform.position.x = pose.x;
13506 flame.transform.position.y = pose.y;
13507 flame.transform.size = { x: pose.w, y: pose.h };
13336 }
13508 }
13337 else if (app.flames[block.id])
13509 else if (app.flames[block.id])
13338 { app.flames[block.id].renderer.visible = false; }
13510 { app.flames[block.id].renderer.visible = false; }
docs/ASSUMPTIONS.md +27 −0
@@ -998,3 +998,30 @@ Tests: `test/flight-local.test.js`; browser: `test/t1181-flights-playwright.py`
998 998 Tests: `test/mini-predict.test.js`, plus de mini-meting in
999 999 `test/t1181-flights-playwright.py`.
1000 1000
1001 ## t1183 — raketvlam: random frames, flip, schaal en rotatie
1002
1003 - Nieuwe sprite van Tim (`build/images/flame.png`, 4 frames op een rij)
1004 ongewijzigd gebruikt.
1005 - `src/flameFx.js` (`FlameFx`) stuurt de vlam aan in plaats van de
1006 framework-animatie `burn`:
1007 - `FPS` = 25 (was 0,08 s per frame = 12,5 fps; verdubbeld).
1008 - Elke tick een willekeurig frame dat **altijd** anders is dan het huidige
1009 (uniform uit de andere drie).
1010 - 50% kans op horizontaal spiegelen (`mirrorX`).
1011 - Onafhankelijke variatie: totale schaal ±6% (`SCALE_VAR`), breedte ±7%
1012 (`WIDTH_VAR`), hoogte ±7% (`HEIGHT_VAR`); samen maximaal ca. ±13%.
1013 - Rotatie ±2,5° (`ROT_VAR_DEG`).
1014 - Elke vlam heeft een eigen willekeurige fase, zodat meerdere raketten
1015 niet tegelijk wisselen.
1016 - Anker: het framework tekent sprites gecentreerd en roteert/spiegelt om
1017 het midden. `FlameFx.pose` zet het midden op `anker + R(θ)·(0, h/2)`, zodat
1018 het bovenste midden (waar de vlam het blok raakt) exact op dezelfde plek
1019 blijft. Het framework rondt de positie af op hele pixels (max. 0,5 px).
1020 - Verminderde beweging (`prefers-reduced-motion: reduce`): 12,5 fps, wel
1021 willekeurige frames, geen spiegelen/schalen/roteren. (Het effect had dit
1022 eerder niet; dit is de "nette" ondergrens.)
1023 - Bij een haperend frame (lange dt) wordt één keer gerold, niet tientallen
1024 keren.
1025
1026 Tests: `test/flame-fx.test.js`; browser: `test/t1183-flame-playwright.py URL TAG`.
1027
@@ -998,3 +998,30 @@ Tests: `test/flight-local.test.js`; browser: `test/t1181-flights-playwright.py`
998Tests: `test/mini-predict.test.js`, plus de mini-meting in
998Tests: `test/mini-predict.test.js`, plus de mini-meting in
999`test/t1181-flights-playwright.py`.
999`test/t1181-flights-playwright.py`.
1000
1000
1001## t1183 — raketvlam: random frames, flip, schaal en rotatie
1002
1003- Nieuwe sprite van Tim (`build/images/flame.png`, 4 frames op een rij)
1004 ongewijzigd gebruikt.
1005- `src/flameFx.js` (`FlameFx`) stuurt de vlam aan in plaats van de
1006 framework-animatie `burn`:
1007 - `FPS` = 25 (was 0,08 s per frame = 12,5 fps; verdubbeld).
1008 - Elke tick een willekeurig frame dat **altijd** anders is dan het huidige
1009 (uniform uit de andere drie).
1010 - 50% kans op horizontaal spiegelen (`mirrorX`).
1011 - Onafhankelijke variatie: totale schaal ±6% (`SCALE_VAR`), breedte ±7%
1012 (`WIDTH_VAR`), hoogte ±7% (`HEIGHT_VAR`); samen maximaal ca. ±13%.
1013 - Rotatie ±2,5° (`ROT_VAR_DEG`).
1014 - Elke vlam heeft een eigen willekeurige fase, zodat meerdere raketten
1015 niet tegelijk wisselen.
1016- Anker: het framework tekent sprites gecentreerd en roteert/spiegelt om
1017 het midden. `FlameFx.pose` zet het midden op `anker + R(θ)·(0, h/2)`, zodat
1018 het bovenste midden (waar de vlam het blok raakt) exact op dezelfde plek
1019 blijft. Het framework rondt de positie af op hele pixels (max. 0,5 px).
1020- Verminderde beweging (`prefers-reduced-motion: reduce`): 12,5 fps, wel
1021 willekeurige frames, geen spiegelen/schalen/roteren. (Het effect had dit
1022 eerder niet; dit is de "nette" ondergrens.)
1023- Bij een haperend frame (lange dt) wordt één keer gerold, niet tientallen
1024 keren.
1025
1026Tests: `test/flame-fx.test.js`; browser: `test/t1183-flame-playwright.py URL TAG`.
1027