mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 20:45:33 -08:00
Add Flock Dash, the thirteenth Activities game, with sounds and music
AI Assisted
This commit is contained in:
1 parent
e924cf5cde
commit
6376a68f85
20 files changed
+4218
-31
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
||||
// Web console tests, the activities: the shared game contract every listed game answers, Snake's rules, mini golf's rules, course and controls, Light Trails' rules and rivals, Bug Hunt's waves, bugs and bosses, Sunset Drive's road, traffic and forks, Stack Deploy's drops, perfects and twists, Bumper Ring's physics, rivals and arenas, the lives pill and tones of Rapids Run, Ghoul Rush and Bounce Road (their rules live in their own suites), Hot Potato's bomb, fuse, rivals and venues, and Crossing Rush's lanes, hops, shoves, planner and zones.
|
||||
// Web console tests, the activities: the shared game contract every listed game answers, Snake's rules, mini golf's rules, course and controls, Light Trails' rules and rivals, Bug Hunt's waves, bugs and bosses, Sunset Drive's road, traffic and forks, Stack Deploy's drops, perfects and twists, Bumper Ring's physics, rivals and arenas, the lives pill and tones of Rapids Run, Ghoul Rush, Bounce Road and Flock Dash (their rules live in their own suites), Hot Potato's bomb, fuse, rivals and venues, and Crossing Rush's lanes, hops, shoves, planner and zones.
|
||||
// Run with: node --test scripts/test-web-console-activities.mjs
|
||||
//
|
||||
// No browser and no server: a game draws only through the canvas it is handed,
|
||||
@@ -29,6 +29,7 @@ import { hudLayout as hopHudLayout, labelSpot as hopLabelSpot, LANES as HOP_LANE
|
||||
import * as bounce from "../src/web-console/public/activities/bounce.js";
|
||||
import * as rapids from "../src/web-console/public/activities/rapids.js";
|
||||
import * as ghoul from "../src/web-console/public/activities/ghoul-rush/ghoul.js";
|
||||
import * as flock from "../src/web-console/public/activities/flock.js";
|
||||
import { ACCENTS } from "../src/web-console/public/palette.js";
|
||||
import { LIVES, LIVES_BACK, LIVES_INK, livesText, pillContrast } from "../src/web-console/public/activities/pills.js";
|
||||
|
||||
@@ -262,8 +263,8 @@ const listedGames = async () => {
|
||||
|
||||
/* --------------------------------------------------------------- list */
|
||||
|
||||
test("the list names Snake, Mini golf, Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring, Rapids Run, Hot Potato, Crossing Rush, Bounce Road and Ghoul Rush, and each entry's module is a file under public/activities/", () => {
|
||||
assert.deepEqual(ACTIVITIES.map((a) => a.id), ["snake", "golf", "trails", "bugs", "drive", "stack", "bumper", "rapids", "fuse", "hop", "bounce", "ghoul"]);
|
||||
test("the list names Snake, Mini golf, Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring, Rapids Run, Hot Potato, Crossing Rush, Bounce Road, Ghoul Rush and Flock Dash, and each entry's module is a file under public/activities/", () => {
|
||||
assert.deepEqual(ACTIVITIES.map((a) => a.id), ["snake", "golf", "trails", "bugs", "drive", "stack", "bumper", "rapids", "fuse", "hop", "bounce", "ghoul", "flock"]);
|
||||
assert.equal(ACTIVITIES[1].title, "Mini golf");
|
||||
assert.equal(ACTIVITIES[2].title, "Light Trails");
|
||||
assert.equal(ACTIVITIES[3].title, "Bug Hunt");
|
||||
@@ -275,6 +276,7 @@ test("the list names Snake, Mini golf, Light Trails, Bug Hunt, Sunset Drive, Sta
|
||||
assert.equal(ACTIVITIES[9].title, "Crossing Rush");
|
||||
assert.equal(ACTIVITIES[10].title, "Bounce Road");
|
||||
assert.equal(ACTIVITIES[11].title, "Ghoul Rush");
|
||||
assert.equal(ACTIVITIES[12].title, "Flock Dash");
|
||||
for (const a of ACTIVITIES) {
|
||||
assert.ok(Object.isFrozen(a), `${a.id} is frozen`);
|
||||
assert.equal(a.module, a.id === "ghoul" ? "/activities/ghoul-rush/ghoul.js" : `/activities/${a.id}.js`);
|
||||
@@ -308,7 +310,7 @@ test("memoKey builds a flat looks.json key from a list id", () => {
|
||||
|
||||
test("musicKey builds a flat looks.json key, and a game with music has a default volume a saved one replaces", () => {
|
||||
assert.equal(musicKey("ghoul"), "activityMusicGhoul");
|
||||
assert.deepEqual(ACTIVITIES.filter((a) => a.music !== undefined).map((a) => [a.id, a.music]), [["snake", 70], ["trails", 70], ["drive", 70], ["ghoul", 65]], "the games with music, at about the level they were picked at on the prototype pages");
|
||||
assert.deepEqual(ACTIVITIES.filter((a) => a.music !== undefined).map((a) => [a.id, a.music]), [["snake", 70], ["trails", 70], ["drive", 70], ["ghoul", 65], ["flock", 70]], "the games with music, at about the level they were picked at on the prototype pages");
|
||||
const ghoulEntry = ACTIVITIES.find((a) => a.id === "ghoul");
|
||||
assert.equal(musicLevel(ghoulEntry, undefined), 0.65, "nothing saved: the default");
|
||||
assert.equal(musicLevel(ghoulEntry, "loud"), 0.65, "not a number: the default");
|
||||
@@ -2450,6 +2452,30 @@ test("Light Trails: a Wide Trail lays your wall three cells wide, and the cells
|
||||
assert.equal(you.wide.length, 0, "wiped cells leave the list");
|
||||
});
|
||||
|
||||
test("Light Trails: on a Wide Trail you turn onto the side cells just laid, but the older ones are still wall", () => {
|
||||
const round = racing(trails.newRound(still));
|
||||
const you = round.riders[0];
|
||||
park(round, you, 10, 15, "right");
|
||||
trails.applyPower(round, "wide");
|
||||
trails.advance(round, trails.STEP_MS, still);
|
||||
assert.deepEqual({ x: you.x, y: you.y }, { x: 11, y: 15 });
|
||||
assert.equal(trails.turn(round, "up"), true);
|
||||
trails.advance(round, trails.STEP_MS, still);
|
||||
assert.equal(you.alive, true, "the corner turn rides onto the fresh side cell");
|
||||
assert.deepEqual({ x: you.x, y: you.y }, { x: 11, y: 14 });
|
||||
assert.ok(!you.wide.some((c) => c.x === 11 && c.y === 14), "that cell is the line now, not a side cell");
|
||||
// Only the pair beside your head is fresh: one step on, the last pair is wall.
|
||||
trails.advance(round, trails.STEP_MS, still);
|
||||
assert.deepEqual({ x: you.x, y: you.y }, { x: 11, y: 13 });
|
||||
assert.deepEqual(you.fresh.map((c) => `${c.x},${c.y}`).sort(), ["10,13", "12,13"]);
|
||||
// Riding back down into a side cell laid two steps ago is a crash as ever.
|
||||
park(round, you, 12, 15, "up");
|
||||
round.grid[14 * trails.COLS + 12] = 1;
|
||||
you.fresh = [];
|
||||
trails.advance(round, trails.STEP_MS + trails.GRACE_MS + 8, still);
|
||||
assert.equal(you.alive, false, "an older side cell is your wall");
|
||||
});
|
||||
|
||||
test("Light Trails: Hyperjump moves you to an open cell clear of everyone, facing open space", () => {
|
||||
const round = racing(trails.newRound(still));
|
||||
const you = round.riders[0];
|
||||
@@ -6232,7 +6258,7 @@ test("lives read at a glance: a heart per life up to five, a count past that, an
|
||||
});
|
||||
|
||||
test("every game with lives draws them in the lives pill, solid, with a heart per life", () => {
|
||||
for (const [name, game] of [["trails", trails], ["bugs", bugs], ["bumper", bumper], ["fuse", fuse], ["hop", hop], ["bounce", bounce], ["rapids", rapids], ["ghoul", ghoul]]) {
|
||||
for (const [name, game] of [["trails", trails], ["bugs", bugs], ["bumper", bumper], ["fuse", fuse], ["hop", hop], ["bounce", bounce], ["rapids", rapids], ["ghoul", ghoul], ["flock", flock]]) {
|
||||
const { canvas, pills, reset } = pillCanvas("#ffffff");
|
||||
const g = game.default.create({ canvas });
|
||||
g.resize(900, 900);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Page tests for Activities: the die in the top bar on every screen, the
|
||||
// window opening on the picker (a card per game, walked by the arrows, one
|
||||
// game at a time, All games back to it), Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring, Rapids Run, Hot Potato, Crossing Rush, Bounce Road and Ghoul Rush in play, the keys
|
||||
// game at a time, All games back to it), Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring, Rapids Run, Hot Potato, Crossing Rush, Bounce Road, Ghoul Rush and Flock Dash in play, the keys
|
||||
// staying inside the window, Esc and P, and every pause rule (a new question,
|
||||
// a finish, a hidden page, a window blur), none of which ever resumes play by
|
||||
// itself. Mini golf in the real window: aim by mouse, two clicks to putt,
|
||||
@@ -166,7 +166,7 @@ test("the die sits right of the megaphone and opens on the picker, a card per ga
|
||||
const next = await s.page.evaluate(() => document.getElementById("btn-feedback").nextElementSibling?.id);
|
||||
assert.equal(next, "btn-activities");
|
||||
await openPicker(s);
|
||||
assert.deepEqual(await cardTitles(s), ["Snake", "Mini golf", "Light Trails", "Bug Hunt", "Sunset Drive", "Stack Deploy", "Bumper Ring", "Rapids Run", "Hot Potato", "Crossing Rush", "Bounce Road", "Ghoul Rush"]);
|
||||
assert.deepEqual(await cardTitles(s), ["Snake", "Mini golf", "Light Trails", "Bug Hunt", "Sunset Drive", "Stack Deploy", "Bumper Ring", "Rapids Run", "Hot Potato", "Crossing Rush", "Bounce Road", "Ghoul Rush", "Flock Dash"]);
|
||||
assert.ok(await s.page.locator("#activities-board").isHidden(), "no board behind the picker");
|
||||
assert.ok(await s.page.locator("#activities-back").isHidden(), "nothing to go back to");
|
||||
assert.equal(await s.page.locator("#activities-title").innerText(), "Activities", "the header names no game");
|
||||
@@ -188,9 +188,9 @@ test("the arrows walk the picker's cards, and space or Enter opens the one in fo
|
||||
assert.equal(await focusedCard(s), "snake");
|
||||
await s.page.keyboard.press("ArrowRight");
|
||||
assert.equal(await focusedCard(s), "golf");
|
||||
for (let i = 0; i < 11; i++) await s.page.keyboard.press("ArrowRight");
|
||||
assert.equal(await focusedCard(s), "ghoul", "the last card stays put");
|
||||
for (let i = 0; i < 10; i++) await s.page.keyboard.press("ArrowLeft");
|
||||
for (let i = 0; i < 12; i++) await s.page.keyboard.press("ArrowRight");
|
||||
assert.equal(await focusedCard(s), "flock", "the last card stays put");
|
||||
for (let i = 0; i < 11; i++) await s.page.keyboard.press("ArrowLeft");
|
||||
assert.equal(await focusedCard(s), "golf");
|
||||
await s.page.keyboard.press("Enter");
|
||||
// Mini golf opens on its course dashboard, walked the same way.
|
||||
@@ -2513,10 +2513,114 @@ test("Ghoul Rush plays in the real window: its board's shape and Planny big enou
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
test("the server serves the activities' scripts, golf's seventeen, Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring's two, Rapids Run's two, Hot Potato's two, Crossing Rush's two, Bounce Road's seven, Ghoul Rush's ninety-five, every game's sound effects and the shared pills included", () => {
|
||||
test("Flock Dash plays in the real window: its board's shape, Enter starts a round, a held up arrow raises the leader until let go, a stray in front of the leader joins the flock, F goes full screen and back, and the last life lost saves the best and the furthest stage", async (t) => {
|
||||
savedLooks(t, { welcomeSeen: true });
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_WORKING });
|
||||
await handTicks(s);
|
||||
// The hazards and crates are cleared before every tick and the leader kept
|
||||
// in grace, so only the keys and the strays placed here move the round.
|
||||
await s.page.evaluate(async () => {
|
||||
const m = await import("/screens/activities.js");
|
||||
const { ACTIVITIES } = await import("/activities.js");
|
||||
const flock = (await import("/activities/flock.js")).default;
|
||||
window.__calm = true;
|
||||
const watched = {
|
||||
...flock,
|
||||
create: (opts) => {
|
||||
const g = flock.create(opts);
|
||||
const tick = g.tick;
|
||||
g.tick = (ms) => {
|
||||
const r = g.round;
|
||||
if (window.__calm && r) {
|
||||
r.hazards.length = r.crates.length = 0;
|
||||
r.leader.grace = 1e9;
|
||||
}
|
||||
tick(ms);
|
||||
};
|
||||
return (window.__flock = g);
|
||||
},
|
||||
};
|
||||
m.setActivityList(ACTIVITIES.map((e) => (e.id === "flock" ? { ...e, game: watched } : e)));
|
||||
});
|
||||
await openActivities(s, "flock");
|
||||
assert.equal(await overlay(s), "Press space to start");
|
||||
const { W, H } = await s.page.evaluate(async () => {
|
||||
const { W, H } = await import("/activities/flock.js");
|
||||
return { W, H };
|
||||
});
|
||||
const box = await s.page.locator("#activities-canvas").boundingBox();
|
||||
assert.ok(Math.abs(box.width / box.height - W / H) < 0.02, `a ${W} by ${H} board, not ${box.width} by ${box.height}`);
|
||||
const you = () =>
|
||||
s.page.evaluate(() => {
|
||||
const r = window.__flock.round;
|
||||
return { ...r.input, y: r.leader.y, flock: r.flock.length, strays: r.strays.length, over: r.over };
|
||||
});
|
||||
// Enter starts a round and has no release: nothing may be left held.
|
||||
await s.page.keyboard.press("Enter");
|
||||
assert.equal(await overlay(s), "", "Enter starts a round");
|
||||
await step(s, 20, 16);
|
||||
let me = await you();
|
||||
assert.deepEqual([me.up, me.down, me.left, me.right], [false, false, false, false], "the start leaves no key held");
|
||||
// A held up arrow raises the leader until let go.
|
||||
const y0 = me.y;
|
||||
await s.page.keyboard.down("ArrowUp");
|
||||
await step(s, 12, 16);
|
||||
me = await you();
|
||||
assert.ok(me.up && me.y < y0 - 1, `held up climbs (${y0} to ${me.y})`);
|
||||
await s.page.keyboard.up("ArrowUp");
|
||||
assert.equal((await you()).up, false, "let go, it stops climbing");
|
||||
await step(s, 40, 16);
|
||||
const rest = (await you()).y;
|
||||
await step(s, 10, 16);
|
||||
assert.ok(Math.abs((await you()).y - rest) < 0.01, "and the leader holds its height");
|
||||
// A stray placed just ahead of the leader joins the flock.
|
||||
const before = (await you()).flock;
|
||||
await s.page.evaluate(() => {
|
||||
const r = window.__flock.round;
|
||||
r.strays.length = 0;
|
||||
window.__strayId = r.nextId++;
|
||||
r.strays.push({ id: window.__strayId, x: r.leader.x + 1.5, y: r.leader.y, bob: 0 });
|
||||
});
|
||||
await until(async () => (await you()).flock > before || (await step(s, 2, 16), false), 5000);
|
||||
assert.ok((await you()).flock >= before + 1, "the stray joined the flock");
|
||||
assert.ok(
|
||||
await s.page.evaluate(() => !window.__flock.round.strays.some((b) => b.id === window.__strayId)),
|
||||
"and it is the placed stray that is gone from the sky"
|
||||
);
|
||||
// F fills the screen and F puts it back, the round still running.
|
||||
await s.page.keyboard.press("f");
|
||||
await until(async () => (await fullParts(s)).full, 5000);
|
||||
await s.page.keyboard.press("f");
|
||||
await until(async () => !(await fullParts(s)).full, 5000);
|
||||
assert.equal(await overlay(s), "", "a running game");
|
||||
// Lose the last life: the round ends and saves its best and furthest stage.
|
||||
await s.page.evaluate(async () => {
|
||||
const { hitLeader } = await import("/activities/flock.js");
|
||||
window.__calm = false;
|
||||
const r = window.__flock.round;
|
||||
r.score = Math.max(r.score, 120);
|
||||
r.lives = 1;
|
||||
r.active.shields = 0;
|
||||
r.leader.grace = 0;
|
||||
hitLeader(r);
|
||||
});
|
||||
await step(s, 10, 16);
|
||||
await until(async () => (await overlay(s)).startsWith("Score:"), 5000);
|
||||
const score = await s.page.evaluate(() => window.__flock.score);
|
||||
assert.ok(score >= 120);
|
||||
await until(async () => {
|
||||
const looks = await serverLooks(s);
|
||||
return looks.activityBestFlock === score && looks.activityMemoFlock === 1;
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
test("the server serves the activities' scripts, golf's seventeen, Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring's two, Rapids Run's two, Hot Potato's two, Crossing Rush's two, Bounce Road's seven, Ghoul Rush's ninety-five, Flock Dash's three, every game's sound effects and the shared pills included", () => {
|
||||
const server = fs.readFileSync(new URL("../src/web-console/static.mjs", import.meta.url), "utf8");
|
||||
const servable = server.slice(server.indexOf("const SERVABLE = new Set(["), server.indexOf("]);", server.indexOf("const SERVABLE = new Set([")));
|
||||
for (const file of ["activities.js", "tones.js", "music.js", "activities/snake.js", "activities/snake-music.js", "screens/activities.js", "activities/golf.js", "activities/golf-holes.js", "activities/golf-draw.js", "activities/golf-decor.js", "activities/golf-kit.js", "activities/golf-paint.js", "activities/golf-looks.js", "activities/golf-course-pirate.js", "activities/golf-course-cave.js", "activities/golf-course-dino.js", "activities/golf-course-candy.js", "activities/golf-course-space.js", "activities/golf-course-frost.js", "activities/golf-look-dino.js", "activities/golf-look-candy.js", "activities/golf-look-space.js", "activities/golf-look-frost.js", "activities/trails.js", "activities/bugs.js", "activities/drive.js", "activities/stack.js", "activities/bumper.js", "activities/bumper-draw.js", "activities/rapids.js", "activities/rapids-draw.js", "activities/fuse.js", "activities/fuse-draw.js", "activities/hop.js", "activities/hop-draw.js", "activities/bounce.js", "activities/bounce-draw.js", "activities/bounce-roads.js", "activities/bounce-road.js", "activities/bounce-rivals.js", "activities/bounce-scenery.js", "activities/bounce-cars.js", "activities/ghoul-rush/ghoul.js", "activities/ghoul-rush/draw/ghoul-draw.js", "activities/ghoul-rush/core/ghoul-rooms.js", "activities/ghoul-rush/stages/wing/ghoul-bones.js", "activities/ghoul-rush/stages/wing/ghoul-bones-draw.js", "activities/ghoul-rush/stages/graveyard/ghoul-graveyard.js", "activities/ghoul-rush/stages/graveyard/ghoul-graveyard-draw.js", "activities/ghoul-rush/stages/grounds/ghoul-grounds.js", "activities/ghoul-rush/stages/grounds/ghoul-grounds-draw.js", "activities/ghoul-rush/stages/chapel/ghoul-chapel.js", "activities/ghoul-rush/stages/chapel/ghoul-chapel-draw.js", "activities/ghoul-rush/stages/sanatorium/ghoul-sanatorium.js", "activities/ghoul-rush/stages/sanatorium/ghoul-sanatorium-draw.js", "activities/ghoul-rush/stages/village/ghoul-village.js", "activities/ghoul-rush/stages/village/ghoul-village-draw.js", "activities/ghoul-rush/stages/village/ghoul-village-world.js", "activities/ghoul-rush/stages/village/ghoul-village-wolf.js", "activities/ghoul-rush/stages/mine/ghoul-mine.js", "activities/ghoul-rush/stages/mine/ghoul-mine-draw.js", "activities/ghoul-rush/stages/mine/ghoul-mine-world.js", "activities/ghoul-rush/stages/mine/ghoul-mine-tommy.js", "activities/ghoul-rush/rides/cart/ghoul-cart.js", "activities/ghoul-rush/rides/cart/ghoul-cart-draw.js", "activities/ghoul-rush/rides/sled/ghoul-sled.js", "activities/ghoul-rush/rides/sled/ghoul-sled-draw.js", "activities/ghoul-rush/rides/gurney/ghoul-gurney.js", "activities/ghoul-rush/rides/gurney/ghoul-gurney-draw.js", "activities/ghoul-rush/rides/banister/ghoul-banister.js", "activities/ghoul-rush/rides/banister/ghoul-banister-draw.js", "activities/ghoul-rush/rides/banister/ghoul-sfx-banister.js", "activities/ghoul-rush/rides/hearse/ghoul-hearse.js", "activities/ghoul-rush/rides/hearse/ghoul-hearse-draw.js", "activities/ghoul-rush/rides/wagon/ghoul-wagon.js", "activities/ghoul-rush/rides/wagon/ghoul-wagon-draw.js", "activities/ghoul-rush/rides/pew/ghoul-pew.js", "activities/ghoul-rush/rides/pew/ghoul-pew-draw.js", "activities/ghoul-rush/rides/pew/ghoul-pew-course.js", "activities/ghoul-rush/rides/pew/ghoul-pew-world.js", "activities/ghoul-rush/rides/mower/ghoul-mower.js", "activities/ghoul-rush/rides/mower/ghoul-mower-draw.js", "activities/ghoul-rush/rides/tray/ghoul-tray.js", "activities/ghoul-rush/rides/tray/ghoul-tray-draw.js", "activities/ghoul-rush/stages/carnival/ghoul-carnival.js", "activities/ghoul-rush/stages/carnival/ghoul-carnival-draw.js", "activities/ghoul-rush/stages/carnival/ghoul-carnival-world.js", "activities/ghoul-rush/stages/frozen/ghoul-frozen.js", "activities/ghoul-rush/stages/frozen/ghoul-frozen-draw.js", "activities/ghoul-rush/stages/frozen/ghoul-frozen-world.js", "activities/ghoul-rush/arms/ghoul-flare.js", "activities/ghoul-rush/stages/bog/ghoul-bog.js", "activities/ghoul-rush/stages/bog/ghoul-bog-draw.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-draw.js", "activities/ghoul-rush/rides/mat/ghoul-mat-room.js", "activities/ghoul-rush/rides/mat/ghoul-mat.js", "activities/ghoul-rush/rides/mat/ghoul-mat-draw.js", "activities/ghoul-rush/stages/marrow/ghoul-dollhouse-room.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-eye.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-eye-draw.js", "activities/ghoul-rush/rides/bonestair/ghoul-bonestair-room.js", "activities/ghoul-rush/rides/bonestair/ghoul-bonestair.js", "activities/ghoul-rush/rides/bonestair/ghoul-bonestair-draw.js", "activities/ghoul-rush/stages/marrow/ghoul-pit-room.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-heart.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-heart-draw.js", "activities/ghoul-rush/story/ghoul-ending.js", "activities/ghoul-rush/story/ghoul-ending-draw.js", "activities/ghoul-rush/draw/ghoul-picker-draw.js", "aLine truncated
|
||||
for (const file of ["activities/flock.js", "activities/flock-draw.js", "activities/flock-sfx.js", "activities.js", "tones.js", "music.js", "activities/snake.js", "activities/snake-music.js", "screens/activities.js", "activities/golf.js", "activities/golf-holes.js", "activities/golf-draw.js", "activities/golf-decor.js", "activities/golf-kit.js", "activities/golf-paint.js", "activities/golf-looks.js", "activities/golf-course-pirate.js", "activities/golf-course-cave.js", "activities/golf-course-dino.js", "activities/golf-course-candy.js", "activities/golf-course-space.js", "activities/golf-course-frost.js", "activities/golf-look-dino.js", "activities/golf-look-candy.js", "activities/golf-look-space.js", "activities/golf-look-frost.js", "activities/trails.js", "activities/bugs.js", "activities/drive.js", "activities/stack.js", "activities/bumper.js", "activities/bumper-draw.js", "activities/rapids.js", "activities/rapids-draw.js", "activities/fuse.js", "activities/fuse-draw.js", "activities/hop.js", "activities/hop-draw.js", "activities/bounce.js", "activities/bounce-draw.js", "activities/bounce-roads.js", "activities/bounce-road.js", "activities/bounce-rivals.js", "activities/bounce-scenery.js", "activities/bounce-cars.js", "activities/ghoul-rush/ghoul.js", "activities/ghoul-rush/draw/ghoul-draw.js", "activities/ghoul-rush/core/ghoul-rooms.js", "activities/ghoul-rush/stages/wing/ghoul-bones.js", "activities/ghoul-rush/stages/wing/ghoul-bones-draw.js", "activities/ghoul-rush/stages/graveyard/ghoul-graveyard.js", "activities/ghoul-rush/stages/graveyard/ghoul-graveyard-draw.js", "activities/ghoul-rush/stages/grounds/ghoul-grounds.js", "activities/ghoul-rush/stages/grounds/ghoul-grounds-draw.js", "activities/ghoul-rush/stages/chapel/ghoul-chapel.js", "activities/ghoul-rush/stages/chapel/ghoul-chapel-draw.js", "activities/ghoul-rush/stages/sanatorium/ghoul-sanatorium.js", "activities/ghoul-rush/stages/sanatorium/ghoul-sanatorium-draw.js", "activities/ghoul-rush/stages/village/ghoul-village.js", "activities/ghoul-rush/stages/village/ghoul-village-draw.js", "activities/ghoul-rush/stages/village/ghoul-village-world.js", "activities/ghoul-rush/stages/village/ghoul-village-wolf.js", "activities/ghoul-rush/stages/mine/ghoul-mine.js", "activities/ghoul-rush/stages/mine/ghoul-mine-draw.js", "activities/ghoul-rush/stages/mine/ghoul-mine-world.js", "activities/ghoul-rush/stages/mine/ghoul-mine-tommy.js", "activities/ghoul-rush/rides/cart/ghoul-cart.js", "activities/ghoul-rush/rides/cart/ghoul-cart-draw.js", "activities/ghoul-rush/rides/sled/ghoul-sled.js", "activities/ghoul-rush/rides/sled/ghoul-sled-draw.js", "activities/ghoul-rush/rides/gurney/ghoul-gurney.js", "activities/ghoul-rush/rides/gurney/ghoul-gurney-draw.js", "activities/ghoul-rush/rides/banister/ghoul-banister.js", "activities/ghoul-rush/rides/banister/ghoul-banister-draw.js", "activities/ghoul-rush/rides/banister/ghoul-sfx-banister.js", "activities/ghoul-rush/rides/hearse/ghoul-hearse.js", "activities/ghoul-rush/rides/hearse/ghoul-hearse-draw.js", "activities/ghoul-rush/rides/wagon/ghoul-wagon.js", "activities/ghoul-rush/rides/wagon/ghoul-wagon-draw.js", "activities/ghoul-rush/rides/pew/ghoul-pew.js", "activities/ghoul-rush/rides/pew/ghoul-pew-draw.js", "activities/ghoul-rush/rides/pew/ghoul-pew-course.js", "activities/ghoul-rush/rides/pew/ghoul-pew-world.js", "activities/ghoul-rush/rides/mower/ghoul-mower.js", "activities/ghoul-rush/rides/mower/ghoul-mower-draw.js", "activities/ghoul-rush/rides/tray/ghoul-tray.js", "activities/ghoul-rush/rides/tray/ghoul-tray-draw.js", "activities/ghoul-rush/stages/carnival/ghoul-carnival.js", "activities/ghoul-rush/stages/carnival/ghoul-carnival-draw.js", "activities/ghoul-rush/stages/carnival/ghoul-carnival-world.js", "activities/ghoul-rush/stages/frozen/ghoul-frozen.js", "activities/ghoul-rush/stages/frozen/ghoul-frozen-draw.js", "activities/ghoul-rush/stages/frozen/ghoul-frozen-world.js", "activities/ghoul-rush/arms/ghoul-flare.js", "activities/ghoul-rush/stages/bog/ghoul-bog.js", "activities/ghoul-rush/stages/bog/ghoul-bog-draw.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-draw.js", "activities/ghoul-rush/rides/mat/ghoul-mat-room.js", "activities/ghoul-rush/rides/mat/ghoul-mat.js", "activities/ghoul-rush/rides/mat/ghoul-mat-draw.js", "activities/ghoul-rush/stages/marrow/ghoul-dollhouse-room.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-eye.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-eye-draw.js", "activities/ghoul-rush/rides/bonestair/ghoul-bonestair-room.js", "activities/ghoul-rush/rides/bonestair/ghoul-bonestair.js", "activities/ghoul-rush/rides/bonestair/ghoul-bonestair-draw.js", "activities/ghoul-rush/stages/marrow/ghoul-pit-room.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-heart.js", "activities/ghoul-rush/stages/marrow/ghoul-marrow-heart-draw.js", "activities/ghoul-rush/story/ghoul-ending.js", "activities/ghoul-rush/storLine truncated
|
||||
assert.ok(servable.includes(`"${file}"`), `SERVABLE includes ${file}`);
|
||||
}
|
||||
for (let n = 1; n <= 5; n++) {
|
||||
assert.ok(servable.includes(`"activities/flock-dash/${n}.mp3"`), `SERVABLE includes activities/flock-dash/${n}.mp3`);
|
||||
}
|
||||
});
|
||||
@@ -18,6 +18,8 @@ import { MUSIC_TRACKS } from "../src/web-console/public/activities/snake.js";
|
||||
import snakeSfx from "../src/web-console/public/activities/snake-sfx.js";
|
||||
import { MUSIC_TRACKS as TRAILS_TRACKS } from "../src/web-console/public/activities/trails.js";
|
||||
import trailsSfx from "../src/web-console/public/activities/trails-sfx.js";
|
||||
import { MUSIC_TRACKS as FLOCK_TRACKS } from "../src/web-console/public/activities/flock.js";
|
||||
import flockSfx from "../src/web-console/public/activities/flock-sfx.js";
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const GAMES = path.join(ROOT, "src/web-console/public/activities");
|
||||
@@ -402,6 +404,20 @@ test("music: Light Trails lists exactly the songs it has, each an mp3 on disk th
|
||||
}
|
||||
});
|
||||
|
||||
test("music: Flock Dash lists exactly the songs it has, each an mp3 on disk the server serves, and no chiptune tracks", () => {
|
||||
const songs = new Set(songNames());
|
||||
assert.equal(flockSfx.music, undefined, "its music is the songs, not note data");
|
||||
assert.deepEqual([...FLOCK_TRACKS].sort(), Object.keys(flockSfx.songs).sort(), "the game lists the songs its sound file has");
|
||||
for (const name of FLOCK_TRACKS) {
|
||||
assert.ok(songs.has(name), `song "${name}" exists`);
|
||||
assert.equal(SONG_TABLES.filter((t) => Object.hasOwn(t, name)).length, 1, `${name} is defined once`);
|
||||
assert.ok(!musicNames().includes(name), `${name} is not also a chiptune track`);
|
||||
const file = flockSfx.songs[name];
|
||||
assert.ok(SERVABLE.has(file), `${file} is servable`);
|
||||
assert.ok(fs.statSync(path.join(ROOT, "src/web-console/public", file)).size > 0, `${file} is on disk`);
|
||||
}
|
||||
});
|
||||
|
||||
// A stand-in <audio>: records what music.js asks of it.
|
||||
class FakeAudio {
|
||||
static made = [];
|
||||
|
||||
Reference in new issue
Block a user