fix: exits place player in front of door, not on it

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 <noreply@anthropic.com>
This commit is contained in:
Jose Luis
2026-03-20 16:49:40 +01:00
parent eee405d5d9
commit b60edc49af
2 changed files with 6 additions and 5 deletions

View File

@@ -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' },

View File

@@ -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 }
],