feat: expand campaign and refine puzzle visuals and controls

This commit is contained in:
cabinw
2026-09-09 11:02:45 +08:00
parent 9f8990b579
commit 70b021d4cc
66 changed files with 41108 additions and 10553 deletions
+21
View File
@@ -0,0 +1,21 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { Game, solve, validateLevel } from '../src/core.js';
import { makeLabLevel } from '../labs/hex-video/fixture.js';
test('video lab fixture validates and can complete through real game actions', () => {
const level = makeLabLevel();
assert.deepEqual(validateLevel(level), []);
assert.equal(level.tiles.length, 18);
const solution = solve(level), game = new Game(level);
assert.equal(solution.solvable, true);
const blocked = game.tap('lab-0');
assert.equal(blocked.status, 'blocked');
assert.equal(game.moves, level.moveLimit);
for (const id of solution.order) assert.equal(game.tap(id).status, 'exit');
assert.equal(game.won, true);
assert.equal(game.moves, 0);
assert.equal(game.undo(), true);
assert.equal(game.won, false);
assert.equal(game.tiles.length, 1);
});