Progress bar and steps while generating, loading, opening claims and travelling; saving chip (t30)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 18:54:06 -04:00
co-authored by Claude Opus 5.5
parent 4d5fca6dae
commit 66543bbd4b
13 changed files with 162 additions and 34 deletions
+9
View File
@@ -6,6 +6,15 @@ const { check, done } = suite();
const fresh = () => { flatWorld(run, 240, 160, 100); run('player.tankTier = 3; saplings = []; stats.grown = 0;'); };
const box = (x0, y0, x1, y1, m) => rect(run, x0, y0, x1, y1, m);
const { createHash } = require('node:crypto');
const worldHash = () => { const hash = createHash('sha256'); for (const k of ['mat', 'temp', 'flags']) { const a = run(k); hash.update(new Uint8Array(a.buffer, a.byteOffset, a.byteLength)); } return hash.digest('hex'); };
run('generateWorld(4242, 512, 384)');
const generatedHash = worldHash();
const progress = [];
run('generateWorld')(4242, 512, 384, (f, label) => progress.push([f, label]));
check('generation progress rises to 1 with named steps', progress.length > 10 && progress[0][0] === 0 && progress.at(-1)[0] === 1 && progress.every(([f, label], i) => f >= 0 && f <= 1 && (!i || f >= progress[i - 1][0]) && typeof label === 'string' && label.length > 0));
check('generation callback keeps the same world', worldHash() === generatedHash);
// 1. acorns sprout on soil under open sky and grow into a tree
fresh();
box(100, 100, 140, 103, run('DIRT'));