From 33f6c98a143866d2e5eb4d044d6cc1db145d5e26 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Tue, 21 Apr 2026 21:20:25 +0700 Subject: [PATCH] fix(levels): redesign L1 and L2 on 8x8 grid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L2 right-side region was disconnected — player could not reach the goal via any sequence of moves (verified via BFS). New L2 places three static guards with two viable paths. L1 widens to 8x8 as a gentle Act 1 intro. Preserves id/name/storyKey/isFinalLevel for progress persistence. --- src/lib/levels/levels.js | 44 +++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/src/lib/levels/levels.js b/src/lib/levels/levels.js index 7312d98..c0cf41d 100644 --- a/src/lib/levels/levels.js +++ b/src/lib/levels/levels.js @@ -1,30 +1,38 @@ export const LEVELS = [ // === ACT 1: THE OUTSKIRTS (movement + static guards) === { + // L1 Garden Path — 8x8, 0 guards. Teaches movement with a winding corridor + // that has no true "wrong" branches — every open cell leads somewhere useful. id: 1, name: "Garden Path", storyKey: "level1Story", - grid: { rows: 6, cols: 6 }, + grid: { rows: 8, cols: 8 }, player: { row: 0, col: 0 }, - goal: { row: 5, col: 5 }, + goal: { row: 7, col: 7 }, walls: [ - { row: 1, col: 1 }, { row: 1, col: 2 }, { row: 1, col: 3 }, - { row: 3, col: 2 }, { row: 3, col: 3 }, { row: 3, col: 4 }, - { row: 4, col: 0 }, { row: 4, col: 1 }, + { row: 1, col: 1 }, { row: 1, col: 2 }, { row: 1, col: 3 }, { row: 1, col: 4 }, + { row: 2, col: 4 }, { row: 2, col: 6 }, + { row: 3, col: 0 }, { row: 3, col: 1 }, { row: 3, col: 4 }, { row: 3, col: 6 }, + { row: 4, col: 4 }, { row: 4, col: 6 }, + { row: 5, col: 1 }, { row: 5, col: 2 }, { row: 5, col: 3 }, { row: 5, col: 4 }, { row: 5, col: 6 }, + { row: 6, col: 1 }, ], guards: [], - parMoves: 10, + parMoves: 16, }, { + // L2 Watchtower — 8x8, 3 static guards with TWO disjoint paths around them. + // Fixes the original L2 connectivity bug (right-side region unreachable). id: 2, name: "The Watchtower", storyKey: "level2Story", - grid: { rows: 6, cols: 6 }, + grid: { rows: 8, cols: 8 }, player: { row: 0, col: 0 }, - goal: { row: 5, col: 5 }, + goal: { row: 7, col: 7 }, walls: [ - { row: 1, col: 3 }, { row: 2, col: 1 }, { row: 2, col: 2 }, - { row: 3, col: 3 }, { row: 3, col: 4 }, { row: 4, col: 1 }, + { row: 1, col: 2 }, { row: 2, col: 1 }, { row: 2, col: 6 }, + { row: 3, col: 2 }, { row: 3, col: 5 }, + { row: 6, col: 3 }, { row: 6, col: 5 }, ], guards: [ { @@ -37,14 +45,22 @@ export const LEVELS = [ }, { type: "static", - position: { row: 4, col: 2 }, + position: { row: 5, col: 2 }, litCells: [ - { row: 3, col: 2 }, { row: 4, col: 3 }, - { row: 5, col: 2 }, + { row: 4, col: 2 }, { row: 5, col: 1 }, + { row: 5, col: 3 }, { row: 6, col: 2 }, + ], + }, + { + type: "static", + position: { row: 5, col: 6 }, + litCells: [ + { row: 4, col: 6 }, { row: 5, col: 5 }, + { row: 5, col: 7 }, { row: 6, col: 6 }, ], }, ], - parMoves: 12, + parMoves: 18, }, // === ACT 2: THE VEGETABLE GARDEN (walls as shields + rotating guards) ===