From b60edc49af0eebd55cadf72a2e8360f819f18cf0 Mon Sep 17 00:00:00 2001 From: Jose Luis Date: Fri, 20 Mar 2026 16:49:40 +0100 Subject: [PATCH] fix: exits place player in front of door, not on it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When exiting the lab, appear one tile below the town's entrance door instead of ON the door tile, which caused an infinite re-trigger loop. Same pattern for all map transitions — land adjacent to the exit, not on top of it. Co-Authored-By: Claude Opus 4.6 --- editor.html | 4 ++-- js/world/maps.js | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/editor.html b/editor.html index 127971f..d9e08d1 100644 --- a/editor.html +++ b/editor.html @@ -261,8 +261,8 @@ function loadCurrentGameData() { { id: 'professor', x: 5, y: 1, facing: 'down', dialog: ['Welcome to the Circuit Lab!','I\'m the Professor. We study logic gates here.','Use the workshop tables to design circuits.','Press TAB to open the Workshop anytime!'] } ]; mapData.lab.exits = [ - { x: 4, y: 11, targetMap: 'pallet-town', targetX: 10, targetY: 7 }, - { x: 5, y: 11, targetMap: 'pallet-town', targetX: 10, targetY: 7 } + { x: 4, y: 11, targetMap: 'pallet-town', targetX: 10, targetY: 8 }, + { x: 5, y: 11, targetMap: 'pallet-town', targetX: 10, targetY: 8 } ]; mapData.lab.interactions = [ { x: 2, y: 3, type: 'workshop', label: 'Workshop Table' }, diff --git a/js/world/maps.js b/js/world/maps.js index cfb1546..ec86041 100644 --- a/js/world/maps.js +++ b/js/world/maps.js @@ -67,8 +67,9 @@ const labMap = { wallSet: buildWallSet(10, 12, labWalls), exits: [ - { x: 4, y: 11, targetMap: 'town', targetX: 10, targetY: 7 }, - { x: 5, y: 11, targetMap: 'town', targetX: 10, targetY: 7 } + // Exit door — appear one tile BELOW the town door (not ON it, to avoid re-trigger) + { x: 4, y: 11, targetMap: 'town', targetX: 10, targetY: 8 }, + { x: 5, y: 11, targetMap: 'town', targetX: 10, targetY: 8 } ], npcs: [ @@ -172,7 +173,7 @@ const townMap = { wallSet: buildWallSet(20, 18, townWalls), exits: [ - // Door into lab building + // Door into lab — appear one tile ABOVE the lab exit (not ON it, to avoid re-trigger) { x: 10, y: 7, targetMap: 'lab', targetX: 4, targetY: 10 } ],