-
Shortcut Game
+
Shortcut Puzzle
Start from 1-1
Stage Select
diff --git a/routes/stage-select/params.svelte.ts b/routes/stage-select/params.svelte.ts
index 82d25fe..ae837b7 100644
--- a/routes/stage-select/params.svelte.ts
+++ b/routes/stage-select/params.svelte.ts
@@ -2,12 +2,14 @@ import { browser } from "$app/environment";
import { replaceState } from "$app/navigation";
import { onMount } from "svelte";
-export const MAX_WORLD = 4;
+export const MAX_WORLD = 6;
const WORLD_STAGES_MAP = new Map([
[1, 4],
[2, 4],
[3, 4],
- [4, 2],
+ [4, 4],
+ [5, 4],
+ [6, 4],
]);
export class SearchParamState {
diff --git a/src/ability.ts b/src/ability.ts
index 4c45f08..84f477e 100644
--- a/src/ability.ts
+++ b/src/ability.ts
@@ -176,8 +176,8 @@ export function canPlaceMovableObject(cx: Context, x: number, y: number, object:
const positionX = x + i.x;
const positionY = y + i.y;
const target = grid.getBlock(cx, positionX, positionY);
- if (target && target !== Block.switch) {
- // すでに何かある場合は、ペーストできない
+ if (target === undefined || (target && target !== Block.switch)) {
+ // すでに何かある場合or範囲外は、ペーストできない
return false;
}
}
diff --git a/src/grid.ts b/src/grid.ts
index 4df28fc..5dedb66 100644
--- a/src/grid.ts
+++ b/src/grid.ts
@@ -295,7 +295,10 @@ export class Grid {
}
this.oobFallableSprites = [];
}
- getBlock(cx: Context, x: number, y: number): Block | null {
+ getBlock(cx: Context, x: number, y: number): Block | null | undefined {
+ const cells = get(cx.state).cells;
+ if (y < 0 || y >= cells.length) return undefined;
+ if (x < 0 || x >= cells[y].length) return undefined;
return get(cx.state).cells[y]?.[x]?.block ?? null;
}
// satisfies: every(MovableObject.relativePositions, (pos) => pos.x >= 0)
diff --git a/src/stages.ts b/src/stages.ts
index e09cf94..9db4af4 100644
--- a/src/stages.ts
+++ b/src/stages.ts
@@ -4,8 +4,18 @@ import { world1 } from "./stages/world1.ts";
import { world2 } from "./stages/world2.ts";
import { world3 } from "./stages/world3.ts";
import { world4 } from "./stages/world4.ts";
+import { world5 } from "./stages/world5.ts";
+import { world6 } from "./stages/world6.ts";
export const stages = new Map
([
+ ["1-1", world1.stage1],
+ ["1-2", world1.stage2],
+ ["1-3", world1.stage3],
+ ["1-4", world1.stage4],
+ ["2-1", world2.stage1],
+ ["2-2", world2.stage2],
+ ["2-3", world2.stage3],
+ ["2-4", world2.stage4],
["1-1", world1.stage1],
["1-2", world1.stage2],
["1-3", world1.stage3],
@@ -20,4 +30,14 @@ export const stages = new Map([
["3-4", world3.stage4],
["4-1", world4.stage1],
["4-2", world4.stage2],
+ ["4-3", world4.stage3],
+ ["4-4", world4.stage4],
+ ["5-1", world5.stage1],
+ ["5-2", world5.stage2],
+ ["5-3", world5.stage3],
+ ["5-4", world5.stage4],
+ ["6-1", world6.stage1],
+ ["6-2", world6.stage2],
+ ["6-3", world6.stage3],
+ ["6-4", world6.stage4],
]);
diff --git a/src/stages/world1.ts b/src/stages/world1.ts
index 9296075..5ae2385 100644
--- a/src/stages/world1.ts
+++ b/src/stages/world1.ts
@@ -5,90 +5,122 @@ export namespace world1 {
export const stage1: StageDefinition = {
stage: [
"bbbbbbbbbbbbbbbbbb",
- ".........b........",
- ".........b......g.",
- ".........b...bbbbb",
- ".........m...bbbbb",
+ "..................",
+ "..................",
+ "...............g..",
+ "............bbbbbb",
+ "......bbbbbbbbbbbb",
"bbbbbbbbbbbbbbbbbb",
],
- isTutorial: true,
+ isTutorial: false,
initialPlayerX: 1,
- initialPlayerY: 5,
+ initialPlayerY: 6,
+ inventoryIsInfinite: false,
blockGroups: [],
switchGroups: [],
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
};
export const stage2: StageDefinition = {
stage: [
"bbbbbbbbbbbbbbbbbb",
- "..................",
- "...............g..",
- "m............bbbbb",
- "bb...........bbbbb",
- "bb.....m.....bbbbb",
+ "........b.........",
+ "........b.........",
+ "........b.........",
+ "........b.........",
+ "........m.......g.",
"bbbbbbbbbbbbbbbbbb",
],
- isTutorial: true,
- initialPlayerX: 3,
+ isTutorial: false,
+ initialPlayerX: 2,
initialPlayerY: 6,
+ inventoryIsInfinite: false,
blockGroups: [],
switchGroups: [],
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
};
-
export const stage3: StageDefinition = {
stage: [
"bbbbbbbbbbbbbbbbbb",
- "...b............g.",
- "...b....m......bbb",
- "...bm..........bbb",
- "...bbb.........bbb",
- "...mm..........bbb",
- "bbbbbbbbbbb....bbb",
+ "..................",
+ "..................",
+ "..................",
+ "..................",
+ "..................",
+ "mmmm............g.",
+ "bbbbbbbb....bbbbbb",
],
- initialPlayerX: 1,
+ isTutorial: false,
+ initialPlayerX: 5,
initialPlayerY: 6,
+ inventoryIsInfinite: false,
blockGroups: [
{
- x: 3,
- y: 5,
+ x: 0,
+ y: 6,
+ objectId: "1",
+ },
+ {
+ x: 1,
+ y: 6,
objectId: "1",
},
{
- x: 4,
- y: 5,
+ x: 2,
+ y: 6,
+ objectId: "1",
+ },
+ {
+ x: 3,
+ y: 6,
objectId: "1",
},
],
switchGroups: [],
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
};
-
export const stage4: StageDefinition = stagePreprocess({
stage: [
- "bbbbbbbbbbbbbbbbbbbbbb",
- "......................",
- "....................g.",
- "...................bbb",
- "m..................bbb",
- "bb.................bbb",
- "bb..........m......bbb",
- "bb.........mm......bbb",
- "bb..bb...bbbbb.....bbb",
- "bb..bbb............bbb",
- "bb..bbbb..m........bbb",
- "bb..bbbbbbbbbbb....bbb",
+ "bbbbbbbbbbbbbbbbbbbbb",
+ ".....................",
+ "...g.................",
+ "bbbbbbbbbb...........",
+ ".....................",
+ ".....................",
+ "............bbbbbbbbb",
+ "....m.........m......",
+ "....mm.......mm......",
+ "bbbbbbbbbbbbbbbbbbbbb",
],
overlay: [
- "bbbbbbbbbbbbbbbbbbbbbb",
- "......................",
- "....................g.",
- "...................bbb",
- "1..................bbb",
- "bb.................bbb",
- "bb..........2......bbb",
- "bb...S.....22......bbb",
- "bb..bb...bbbbb.....bbb",
- "bb..bbb............bbb",
- "bb..bbbb..3........bbb",
- "bb..bbbbbbbbbbb....bbb",
+ "bbbbbbbbbbbbbbbbbbbbb",
+ ".....................",
+ "...g.................",
+ "bbbbbbbbbb...........",
+ ".....................",
+ ".....................",
+ "............bbbbbbbbb",
+ "....1.........2......",
+ ".S..11.......22......",
+ "bbbbbbbbbbbbbbbbbbbbb",
],
+ isTutorial: false,
+ inventoryIsInfinite: false,
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
});
}
diff --git a/src/stages/world2.ts b/src/stages/world2.ts
index 30a1732..7701d03 100644
--- a/src/stages/world2.ts
+++ b/src/stages/world2.ts
@@ -5,193 +5,114 @@ export namespace world2 {
export const stage1: StageDefinition = {
stage: [
"bbbbbbbbbbbbbbbbbb",
- ".........b........",
- ".........b........",
- ".........w........",
- ".s....m..w.....g..",
- "bSbbbbbbbbbbbbbbbb",
+ "..................",
+ "...............g..",
+ "m............bbbbb",
+ "bb...........bbbbb",
+ "bb.....m.....bbbbb",
+ "bbbbbbbbbbbbbbbbbb",
],
+ isTutorial: false,
initialPlayerX: 3,
- initialPlayerY: 5,
+ initialPlayerY: 6,
blockGroups: [],
- switchGroups: [
- {
- x: 1,
- y: 4,
- switchId: "1",
- },
- {
- x: 9,
- y: 3,
- switchId: "1",
- },
- {
- x: 9,
- y: 4,
- switchId: "1",
- },
- ],
+ switchGroups: [],
};
- export const stage2: StageDefinition = stagePreprocess({
- stage: [
- "bbbbbbbbbbbbbbbbbbbbbbbbb",
- ".........................",
- "......................g..",
- "................bbbbbbbbb",
- "...............wbbbbbbbbb",
- "m...............bbbbbbbbb",
- "bb..............w.....m..",
- "bb..............b....mm..",
- "bb.w....m..s...bb...mmm..",
- "bbbbbbbbbbbSbbbbbbbbbbbbb",
- ],
- overlay: [
- "bbbbbbbbbbbbbbbbbbbbbbbbb",
- ".........................",
- "......................g..",
- "................bbbbbbbbb",
- "...............1bbbbbbbbb",
- "m...............bbbbbbbbb",
- "bb..............1.....2..",
- "bb..............b....22..",
- "bb.1..S.m..1...bb...222..",
- "bbbbbbbbbbb-bbbbbbbbbbbbb",
- ],
- });
- export const stage3 = stagePreprocess({
+ export const stage2: StageDefinition = {
stage: [
"bbbbbbbbbbbbbbbbbb",
- "..................",
- "................g.",
- "........w......bbb",
- "........w.....wbbb",
- ".....bm.w....w.bbb",
- ".....bbb...bbbbbbb",
- "...m.bbb...bbbbbbb",
- "...mm...s.........",
- "bbbbbbbbSbbbbbbbbb",
- ],
- overlay: [
- "bbbbbbbbbbbbbbbbbb",
- "..................",
- "................g.",
- "........1......bbb",
- "........1.....1bbb",
- ".....bm.1....1.bbb",
- ".....bbb...bbbbbbb",
- "...3 bbb...bbbbbbb",
- ".S.33...1.........",
- "bbbbbbbbbbbbbbbbbb",
- ],
- });
- export const stage4: StageDefinition = {
- stage: [
- "bbbbbbbbbbbbbbbbbbbbbbb",
- ".........w...b.........",
- ".........w.g.b...m.....",
- ".........bbbbb.........",
- "m.......w.....w......m.",
- "mm.....w.......w.....mm",
- "bbb..bb.........bb..bbb",
- ".......w.......w.......",
- "....s.m.w.....w...s....",
- "bbbbSbbbbbbbbbbbbbSbbbb",
+ "...b............g.",
+ "...b....m......bbb",
+ "...bm..........bbb",
+ "...bbb.........bbb",
+ "...mm..........bbb",
+ "bbbbbbbbbbb....bbb",
],
initialPlayerX: 1,
- initialPlayerY: 9,
+ initialPlayerY: 6,
blockGroups: [
{
- x: 0,
- y: 4,
- objectId: "1",
- },
- {
- x: 0,
+ x: 3,
y: 5,
objectId: "1",
},
{
- x: 1,
+ x: 4,
y: 5,
objectId: "1",
},
- {
- x: 21,
- y: 4,
- objectId: "2",
- },
- {
- x: 21,
- y: 5,
- objectId: "2",
- },
- {
- x: 22,
- y: 5,
- objectId: "2",
- },
],
- switchGroups: [
- {
- x: 4,
- y: 8,
- switchId: "1",
- },
- {
- x: 7,
- y: 5,
- switchId: "2",
- },
+ switchGroups: [],
+ };
+
+ export const stage3: StageDefinition = {
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbbb",
+ "....b.................",
+ "....b...............g.",
+ "....b..............bbb",
+ "m...b..............bbb",
+ "bb.................bbb",
+ "bb..........m......bbb",
+ "bb.........mm......bbb",
+ "bb..bb...bbbbb.....bbb",
+ "bb..bbb............bbb",
+ "bb..bbbb..m........bbb",
+ "bb..bbbbbbbbbbb....bbb",
+ ],
+ initialPlayerX: 5,
+ initialPlayerY: 7,
+ blockGroups: [
{
- x: 7,
+ x: 11,
y: 7,
- switchId: "1",
- },
- {
- x: 8,
- y: 4,
- switchId: "2",
- },
- {
- x: 8,
- y: 8,
- switchId: "1",
- },
- {
- x: 9,
- y: 1,
- switchId: "2",
- },
- {
- x: 9,
- y: 2,
- switchId: "2",
- },
- {
- x: 14,
- y: 4,
- switchId: "1",
- },
- {
- x: 14,
- y: 8,
- switchId: "2",
- },
- {
- x: 15,
- y: 5,
- switchId: "1",
+ objectId: "1",
},
{
- x: 15,
+ x: 12,
y: 7,
- switchId: "2",
+ objectId: "1",
},
{
- x: 18,
- y: 8,
- switchId: "2",
+ x: 12,
+ y: 6,
+ objectId: "1",
},
],
+ switchGroups: [],
};
+
+ export const stage4: StageDefinition = stagePreprocess({
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbbb",
+ "......................",
+ "..g...................",
+ "bbbbb...............m.",
+ "......................",
+ "..m............b......",
+ ".....m.........b....m.",
+ ".............m.bm..mm.",
+ "........m......b..mm..",
+ "bbbbbbbbbbbbbbbbbbbbbb",
+ ],
+ overlay: [
+ "bbbbbbbbbbbbbbbbbbbbbb",
+ "......................",
+ "..g...................",
+ "bbbbb...............m.",
+ "......................",
+ "..m............b......",
+ ".....m.........b....2.",
+ ".............m.bm..22.",
+ "...S....m......b..22..",
+ "bbbbbbbbbbbbbbbbbbbbbb",
+ ],
+ isTutorial: false,
+ inventoryIsInfinite: false,
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ });
}
diff --git a/src/stages/world3.ts b/src/stages/world3.ts
index 99fbce9..3111fae 100644
--- a/src/stages/world3.ts
+++ b/src/stages/world3.ts
@@ -6,103 +6,236 @@ export namespace world3 {
stage: [
"bbbbbbbbbbbbbbbbbb",
".........b........",
- ".........b......g.",
- ".........b...bbbbb",
- ".........b...bbbbb",
- ".........m...bbbbb",
- "bbbbbbbbbbbbbbbbbb",
+ ".........b........",
+ ".........w........",
+ ".s....m..w.....g..",
+ "bSbbbbbbbbbbbbbbbb",
],
- isTutorial: false,
- initialPlayerX: 1,
- initialPlayerY: 6,
- inventoryIsInfinite: true,
+ initialPlayerX: 3,
+ initialPlayerY: 5,
blockGroups: [],
- switchGroups: [],
- usage: {
- copy: Number.POSITIVE_INFINITY,
- cut: Number.POSITIVE_INFINITY,
- paste: Number.POSITIVE_INFINITY,
- },
- };
- export const stage2: StageDefinition = {
- stage: [
- "bbbbbbbbbbbbbbbbbb",
- "..................",
- "................g.",
- ".............bbbbb",
- "......f......bbbbb",
- "......f......bbbbb",
- "......f......bbbbb",
- "bbbbbbbbb.bb.bbbbb",
+ switchGroups: [
+ {
+ x: 1,
+ y: 4,
+ switchId: "1",
+ },
+ {
+ x: 9,
+ y: 3,
+ switchId: "1",
+ },
+ {
+ x: 9,
+ y: 4,
+ switchId: "1",
+ },
],
- isTutorial: false,
- initialPlayerX: 1,
- initialPlayerY: 6,
- inventoryIsInfinite: true,
- blockGroups: [],
- switchGroups: [],
- usage: {
- copy: Number.POSITIVE_INFINITY,
- cut: Number.POSITIVE_INFINITY,
- paste: Number.POSITIVE_INFINITY,
- },
};
- export const stage3: StageDefinition = {
+ export const stage2: StageDefinition = {
stage: [
- "bbbbbbbbbbbbbbbbb",
- "g...W........w..b",
- "b...bb..bb..bb..b",
- "b...bb..bb..bb..b",
- "b....bf..bs..bm.b",
- "b..bbbbbbbSbbbbbb",
+ "bbbbbbbbbbbbbbbbbbbbbbbbb",
+ ".........................",
+ "......................g..",
+ "................bbbbbbbbb",
+ "...............wbbbbbbbbb",
+ "m...............bbbbbbbbb",
+ "bb..............w.....m..",
+ "bb..............b....mm..",
+ "bb.w....m..s...bb...mmm..",
+ "bbbbbbbbbbbSbbbbbbbbbbbbb",
],
- isTutorial: false,
initialPlayerX: 5,
- initialPlayerY: 1,
- inventoryIsInfinite: true,
- blockGroups: [],
+ initialPlayerY: 8,
+ blockGroups: [
+ {
+ x: 20,
+ y: 8,
+ objectId: "1",
+ },
+ {
+ x: 21,
+ y: 8,
+ objectId: "1",
+ },
+ {
+ x: 21,
+ y: 7,
+ objectId: "1",
+ },
+ {
+ x: 22,
+ y: 6,
+ objectId: "1",
+ },
+ {
+ x: 22,
+ y: 7,
+ objectId: "1",
+ },
+ {
+ x: 22,
+ y: 8,
+ objectId: "1",
+ },
+ ],
switchGroups: [
- { x: 4, y: 1, switchId: "1" },
- { x: 13, y: 1, switchId: "1" },
- { x: 10, y: 4, switchId: "1" },
+ {
+ x: 3,
+ y: 8,
+ switchId: "1",
+ },
+ {
+ x: 11,
+ y: 8,
+ switchId: "1",
+ },
+ {
+ x: 15,
+ y: 4,
+ switchId: "1",
+ },
+ {
+ x: 16,
+ y: 6,
+ switchId: "1",
+ },
],
- usage: {
- copy: Number.POSITIVE_INFINITY,
- cut: Number.POSITIVE_INFINITY,
- paste: Number.POSITIVE_INFINITY,
- },
};
- export const stage4: StageDefinition = stagePreprocess({
+ export const stage3: StageDefinition = stagePreprocess({
stage: [
- "bbbbbbbbbbbbbbbbbbbbbbbb",
- "bbbb..W..w.....bmmmmW...",
- "bbbb..bb.w.........W....",
- ".......b.bbbbbbbbbbb....",
- ".s............w....w....",
- "bSbbb.........w..m.w....",
- "bbbbb.........bbbbbb...b",
- "bbbbb.........bg......bb",
- "bbbbbssss...f.b......bbb",
- "bbbbbSSSSbbbbbb.....bbbb",
+ "bbbbbbbbbbbbbbbbbb",
+ "..................",
+ "................g.",
+ "........w......bbb",
+ "........w.....wbbb",
+ ".....bm.w....w.bbb",
+ ".....bbb...bbbbbbb",
+ "...m.bbb...bbbbbbb",
+ "...mm...s.........",
+ "bbbbbbbbSbbbbbbbbb",
],
overlay: [
- "bbbbbbbbbbbbbbbbbbbbbbbb",
- "bbbb..1..1.....b33332...",
- "bbbb..bb.1.........2....",
- ".......b.bbbbbbbbbbb....",
- ".2............2....2....",
- "b-bbb.........2..m.2....",
- "bbbbb.........bbbbbb...b",
- "bbbbb.........bg......bb",
- "bbbbb1111.S.f.b......bbb",
- "bbbbb----bbbbbb.....bbbb",
+ "bbbbbbbbbbbbbbbbbb",
+ "..................",
+ "................g.",
+ "........1......bbb",
+ "........1.....1bbb",
+ ".....bm.1....1.bbb",
+ ".....bbb...bbbbbbb",
+ "...3 bbb...bbbbbbb",
+ ".S.33...1.........",
+ "bbbbbbbbbbbbbbbbbb",
],
- isTutorial: false,
- inventoryIsInfinite: true,
- usage: {
- copy: Number.POSITIVE_INFINITY,
- cut: Number.POSITIVE_INFINITY,
- paste: Number.POSITIVE_INFINITY,
- },
});
+ export const stage4: StageDefinition = {
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbbbb",
+ ".........w...b.........",
+ ".........w.g.b...m.....",
+ ".........bbbbb.........",
+ "m.......w.....w......m.",
+ "mm.....w.......w.....mm",
+ "bbb..bb.........bb..bbb",
+ ".......w.......w.......",
+ "....s.m.w.....w...s....",
+ "bbbbSbbbbbbbbbbbbbSbbbb",
+ ],
+ initialPlayerX: 1,
+ initialPlayerY: 9,
+ blockGroups: [
+ {
+ x: 0,
+ y: 4,
+ objectId: "1",
+ },
+ {
+ x: 0,
+ y: 5,
+ objectId: "1",
+ },
+ {
+ x: 1,
+ y: 5,
+ objectId: "1",
+ },
+ {
+ x: 21,
+ y: 4,
+ objectId: "2",
+ },
+ {
+ x: 21,
+ y: 5,
+ objectId: "2",
+ },
+ {
+ x: 22,
+ y: 5,
+ objectId: "2",
+ },
+ ],
+ switchGroups: [
+ {
+ x: 4,
+ y: 8,
+ switchId: "1",
+ },
+ {
+ x: 7,
+ y: 5,
+ switchId: "2",
+ },
+ {
+ x: 7,
+ y: 7,
+ switchId: "1",
+ },
+ {
+ x: 8,
+ y: 4,
+ switchId: "2",
+ },
+ {
+ x: 8,
+ y: 8,
+ switchId: "1",
+ },
+ {
+ x: 9,
+ y: 1,
+ switchId: "2",
+ },
+ {
+ x: 9,
+ y: 2,
+ switchId: "2",
+ },
+ {
+ x: 14,
+ y: 4,
+ switchId: "1",
+ },
+ {
+ x: 14,
+ y: 8,
+ switchId: "2",
+ },
+ {
+ x: 15,
+ y: 5,
+ switchId: "1",
+ },
+ {
+ x: 15,
+ y: 7,
+ switchId: "2",
+ },
+ {
+ x: 18,
+ y: 8,
+ switchId: "2",
+ },
+ ],
+ };
}
diff --git a/src/stages/world4.ts b/src/stages/world4.ts
index 91f138f..5f1f479 100644
--- a/src/stages/world4.ts
+++ b/src/stages/world4.ts
@@ -1,56 +1,108 @@
-import { usages } from "./_proto.ts";
+import { stagePreprocess } from "@/stage-preprocessor.ts";
import type { StageDefinition } from "./type.ts";
export namespace world4 {
export const stage1: StageDefinition = {
stage: [
- "bbbbbbbbbbbbbbbbbbbbb",
- "bbbbbbbbbbb..........",
- "bbbbbbbbbbb..........",
- "bbbbbbbbbbz..........",
- ".....................",
- ".....................",
- ".f...................",
- ".m.................g.",
- "bbbbb^^^^^^......bbbb",
+ "bbbbbbbbbbbbbbbbbb",
+ ".........b........",
+ ".........b......g.",
+ ".........b...bbbbb",
+ ".........b...bbbbb",
+ ".........m...bbbbb",
+ "bbbbbbbbbbbbbbbbbb",
],
- initialPlayerX: 4,
- initialPlayerY: 7,
+ isTutorial: false,
+ initialPlayerX: 1,
+ initialPlayerY: 6,
inventoryIsInfinite: true,
- usage: usages.allInf,
blockGroups: [],
switchGroups: [],
- laserDirections: [{ x: 10, y: 3, direction: "down" }],
+ usage: {
+ copy: Number.POSITIVE_INFINITY,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
};
-
export const stage2: StageDefinition = {
stage: [
- "bbbbbbbbbbbbbbbbbbbbb",
- "..........g..........",
- ".........bbb.........",
- "....f...........z....",
- "...bbbbb^^^^^bbbbb...",
- "..b.......w.......b..",
- ".m........w........m.",
- "mm...s....w....f...mm",
- "bbbbbSbbbbbbbbbbbbbbb",
+ "bbbbbbbbbbbbbbbbbb",
+ "..................",
+ "................g.",
+ ".............bbbbb",
+ "......f......bbbbb",
+ "......f......bbbbb",
+ "......f......bbbbb",
+ "bbbbbbbbb.bb.bbbbb",
],
- initialPlayerX: 4,
- initialPlayerY: 4,
- blockGroups: [
- { x: 0, y: 7, objectId: "1" },
- { x: 1, y: 7, objectId: "1" },
- { x: 1, y: 6, objectId: "1" },
- { x: 19, y: 7, objectId: "2" },
- { x: 20, y: 7, objectId: "2" },
- { x: 19, y: 6, objectId: "2" },
+ isTutorial: false,
+ initialPlayerX: 1,
+ initialPlayerY: 6,
+ inventoryIsInfinite: true,
+ blockGroups: [],
+ switchGroups: [],
+ usage: {
+ copy: Number.POSITIVE_INFINITY,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ };
+ export const stage3: StageDefinition = {
+ stage: [
+ "bbbbbbbbbbbbbbbbb",
+ "g...W........w..b",
+ "b...bb..bb..bb..b",
+ "b...bb..bb..bb..b",
+ "b....bf..bs..bm.b",
+ "b..bbbbbbbSbbbbbb",
],
+ isTutorial: false,
+ initialPlayerX: 5,
+ initialPlayerY: 1,
+ inventoryIsInfinite: true,
+ blockGroups: [],
switchGroups: [
- { x: 5, y: 7, switchId: "1" },
- { x: 10, y: 7, switchId: "1" },
- { x: 10, y: 6, switchId: "1" },
- { x: 10, y: 5, switchId: "1" },
+ { x: 4, y: 1, switchId: "1" },
+ { x: 13, y: 1, switchId: "1" },
+ { x: 10, y: 4, switchId: "1" },
],
- laserDirections: [{ x: 16, y: 3, direction: "left" }],
+ usage: {
+ copy: Number.POSITIVE_INFINITY,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
};
+ export const stage4: StageDefinition = stagePreprocess({
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbbbbb",
+ "bbbb..W..w.....bmmmmW...",
+ "bbbb..bb.w.........W....",
+ ".......b.bbbbbbbbbbb....",
+ ".s............w....w....",
+ "bSbbb.........w..m.w....",
+ "bbbbb.........bbbbbb...b",
+ "bbbbb.........bg......bb",
+ "bbbbbssss...f.b......bbb",
+ "bbbbbSSSSbbbbbb.....bbbb",
+ ],
+ overlay: [
+ "bbbbbbbbbbbbbbbbbbbbbbbb",
+ "bbbb..1..1.....b33332...",
+ "bbbb..bb.1.........2....",
+ ".......b.bbbbbbbbbbb....",
+ ".2............2....2....",
+ "b-bbb.........2..m.2....",
+ "bbbbb.........bbbbbb...b",
+ "bbbbb.........bg......bb",
+ "bbbbb1111.S.f.b......bbb",
+ "bbbbb----bbbbbb.....bbbb",
+ ],
+ isTutorial: false,
+ inventoryIsInfinite: true,
+ usage: {
+ copy: Number.POSITIVE_INFINITY,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ });
}
diff --git a/src/stages/world5.ts b/src/stages/world5.ts
new file mode 100644
index 0000000..68c7620
--- /dev/null
+++ b/src/stages/world5.ts
@@ -0,0 +1,133 @@
+import { stagePreprocess } from "@/stage-preprocessor.ts";
+import { usages } from "./_proto.ts";
+import type { StageDefinition } from "./type.ts";
+
+export namespace world5 {
+ export const stage1: StageDefinition = stagePreprocess({
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbbbbb",
+ "....w...................",
+ "....w...................",
+ ".g..w...................",
+ "bbbbbbb.................",
+ ".................bb.....",
+ "....f............bbbbb..",
+ "bbbbbbb.bbwwwwwb.bbm....",
+ "bbbbbbb.bbm..m.b.......m",
+ "bbbbbbbsbbmm.mmb.....smm",
+ "bbbbbbbSbbbbbbbb^bbbbSbb",
+ ],
+ overlay: [
+ "bbbbbbbbbbbbbbbbbbbbbbbb",
+ "....2...................",
+ "....2...................",
+ ".g..2...................",
+ "bbbbbbb.................",
+ ".................bb.....",
+ "..S.f............bbbbb..",
+ "bbbbbbb.bb11111b.bbm....",
+ "bbbbbbb.bb5..3.b.......4",
+ "bbbbbbb1bb55.33b.....244",
+ "bbbbbbb-bbbbbbbb^bbbb-bb",
+ ],
+ inventoryIsInfinite: false,
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ });
+ export const stage2: StageDefinition = stagePreprocess({
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ "...........f.........",
+ "...........fmm......g",
+ "..........bbbb.....bb",
+ ".f...................",
+ "bbbbbb.m.............",
+ "bbbbb..m.............",
+ "bbbbb.mm.............",
+ "bbbbb.^^^^^^^^^^^^^^^",
+ ],
+ overlay: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ "...........f.........",
+ "...........f22......g",
+ "..........bbbb.....bb",
+ ".f.S.................",
+ "bbbbbb.1.............",
+ "bbbbb..1.............",
+ "bbbbb.11.............",
+ "bbbbb.^^^^^^bbbbbbbbb",
+ ],
+ inventoryIsInfinite: false,
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ });
+ export const stage3: StageDefinition = stagePreprocess({
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ ".....................",
+ ".....................",
+ "m..........f.........",
+ "bb.........f...^^....",
+ "..........bb..^bb....",
+ "f.............bbb..g.",
+ "bbbb^b^b^bbb^^bbbbbbb",
+ ],
+ overlay: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ ".....................",
+ ".....................",
+ "m..........f.........",
+ "bb.........f...^^....",
+ "..........bb..^bb....",
+ "f.S...........bbb..g.",
+ "bbbb^b^b^bbb^^bbbbbbb",
+ ],
+ inventoryIsInfinite: false,
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ });
+
+ export const stage4: StageDefinition = stagePreprocess({
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ ".....................",
+ "..fm...........b.....",
+ "..fm...........b.....",
+ "mmmm...........b.....",
+ "bbbb...........b.g...",
+ "bbbb..^.....^..bbbb..",
+ "bbbb..b^..^^b.^b.....",
+ "bbbb..bb..bbb.bb.....",
+ "bbbb..bb..bbf........",
+ "bbbb..bb..bbbbbbbbbbb",
+ ],
+ overlay: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ ".....................",
+ "..fm...........b.....",
+ ".Sfm...........b.....",
+ "mmmm...........b.....",
+ "bbbb...........b.g...",
+ "bbbb..^.....^..bbbb..",
+ "bbbb..b^..^^b.^b.....",
+ "bbbb..bb..bbb.bb.....",
+ "bbbb..bb..bbf........",
+ "bbbb..bb..bbbbbbbbbbb",
+ ],
+ inventoryIsInfinite: false,
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ });
+}
diff --git a/src/stages/world6.ts b/src/stages/world6.ts
new file mode 100644
index 0000000..0815908
--- /dev/null
+++ b/src/stages/world6.ts
@@ -0,0 +1,123 @@
+import { usages } from "./_proto.ts";
+import type { StageDefinition } from "./type.ts";
+
+export namespace world6 {
+ export const stage1: StageDefinition = {
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ "bbbbbbbbbbbbbbbbbbbbb",
+ "bbbbbbbbbbbbzbbbbbbbb",
+ ".....................",
+ "..................g..",
+ "................bbbbb",
+ ".f..............bbbbb",
+ ".m..............bbbbb.",
+ "bbbbbbbb.bbbbbbbbbbbb",
+ "bbbbbbbbzbbbbbbbbbbbb",
+ "bbbbbbbbbbbbbbbbbbbbb",
+ ],
+ initialPlayerX: 4,
+ initialPlayerY: 7,
+ inventoryIsInfinite: false,
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ blockGroups: [],
+ switchGroups: [],
+ laserDirections: [
+ { x: 8, y: 9, direction: "up" },
+ { x: 12, y: 2, direction: "down" },
+ ],
+ };
+ export const stage2: StageDefinition = {
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ "bbbbbbbbbbb..........",
+ "bbbbbbbbbbb..........",
+ "bbbbbbbbbbz..........",
+ ".....................",
+ ".....................",
+ ".f...................",
+ ".m.................g.",
+ "bbbbb^^^^^^......bbbb",
+ ],
+ initialPlayerX: 4,
+ initialPlayerY: 7,
+ inventoryIsInfinite: true,
+ usage: usages.allInf,
+ blockGroups: [],
+ switchGroups: [],
+ laserDirections: [{ x: 10, y: 3, direction: "down" }],
+ };
+ export const stage3: StageDefinition = {
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbbbb",
+ ".......................",
+ ".......................",
+ "f......................",
+ "ff.............g.......",
+ "bbb...........bbb......",
+ "bz..................w..",
+ "bbb...............m.w..",
+ "bz................m.w.m",
+ "bbbbbbbbbbzbbbb.bbbbbbb",
+ "bbbbbbbbbbbbbbbsbbbbbbb",
+ "bbbbbbbbbbbbbbbSbbbbbbb",
+ ],
+ initialPlayerX: 2,
+ initialPlayerY: 5,
+ inventoryIsInfinite: false,
+ usage: {
+ copy: 0,
+ cut: Number.POSITIVE_INFINITY,
+ paste: Number.POSITIVE_INFINITY,
+ },
+ blockGroups: [
+ { x: 18, y: 7, objectId: "1" },
+ { x: 18, y: 8, objectId: "1" },
+ ],
+ switchGroups: [
+ { x: 15, y: 10, switchId: "1" },
+ { x: 20, y: 6, switchId: "1" },
+ { x: 20, y: 7, switchId: "1" },
+ { x: 20, y: 8, switchId: "1" },
+ ],
+ laserDirections: [
+ { x: 1, y: 6, direction: "right" },
+ { x: 1, y: 8, direction: "right" },
+ { x: 10, y: 9, direction: "up" },
+ ],
+ };
+ export const stage4: StageDefinition = {
+ stage: [
+ "bbbbbbbbbbbbbbbbbbbbb",
+ "..........g..........",
+ ".........bbb.........",
+ "....f...........z....",
+ "...bbbbb^^^^^bbbbb...",
+ "..b.......w.......b..",
+ ".m........w........m.",
+ "mm...s....w....f...mm",
+ "bbbbbSbbbbbbbbbbbbbbb",
+ ],
+ initialPlayerX: 4,
+ initialPlayerY: 4,
+ blockGroups: [
+ { x: 0, y: 7, objectId: "1" },
+ { x: 1, y: 7, objectId: "1" },
+ { x: 1, y: 6, objectId: "1" },
+ { x: 19, y: 7, objectId: "2" },
+ { x: 20, y: 7, objectId: "2" },
+ { x: 19, y: 6, objectId: "2" },
+ ],
+ switchGroups: [
+ { x: 5, y: 7, switchId: "1" },
+ { x: 10, y: 7, switchId: "1" },
+ { x: 10, y: 6, switchId: "1" },
+ { x: 10, y: 5, switchId: "1" },
+ ],
+ laserDirections: [{ x: 16, y: 3, direction: "left" }],
+ };
+}