Reduce NPC proximity threshold from 120 to 60px so Press E shows only when truly close

This commit is contained in:
justin committed 2026-05-14 11:02:06 -07:00
1 parent 43f7e6ef1c
commit bb5c1a7316
1 file changed
+2 -2
+2 -2
View File
@@ -238,7 +238,7 @@ class Game {
const viewH = world ? world.parentElement.offsetHeight : 300; const viewH = world ? world.parentElement.offsetHeight : 300;
const playerWorldX = this.state.worldX + viewW / 2; const playerWorldX = this.state.worldX + viewW / 2;
const dx = Math.abs(playerWorldX - this.state.npcWorldX); const dx = Math.abs(playerWorldX - this.state.npcWorldX);
const near = dx < 120; const near = dx < 60;
const hint = document.getElementById('map-talk-hint'); const hint = document.getElementById('map-talk-hint');
const bub = document.getElementById('npc-bubble'); const bub = document.getElementById('npc-bubble');
@@ -267,7 +267,7 @@ class Game {
const world = document.getElementById('map-inner'); const world = document.getElementById('map-inner');
const viewW = world ? world.parentElement.offsetWidth : 420; const viewW = world ? world.parentElement.offsetWidth : 420;
const playerWorldX = this.state.worldX + viewW / 2; const playerWorldX = this.state.worldX + viewW / 2;
return Math.abs(playerWorldX - this.state.npcWorldX) < 120; return Math.abs(playerWorldX - this.state.npcWorldX) < 60;
} }
_talkToNPC() { _talkToNPC() {