Reduce NPC proximity threshold from 120 to 60px so Press E shows only when truly close
This commit is contained in:
1 parent
43f7e6ef1c
commit
bb5c1a7316
1 file changed
+2
-2
@@ -238,7 +238,7 @@ class Game {
|
||||
const viewH = world ? world.parentElement.offsetHeight : 300;
|
||||
const playerWorldX = this.state.worldX + viewW / 2;
|
||||
const dx = Math.abs(playerWorldX - this.state.npcWorldX);
|
||||
const near = dx < 120;
|
||||
const near = dx < 60;
|
||||
|
||||
const hint = document.getElementById('map-talk-hint');
|
||||
const bub = document.getElementById('npc-bubble');
|
||||
@@ -267,7 +267,7 @@ class Game {
|
||||
const world = document.getElementById('map-inner');
|
||||
const viewW = world ? world.parentElement.offsetWidth : 420;
|
||||
const playerWorldX = this.state.worldX + viewW / 2;
|
||||
return Math.abs(playerWorldX - this.state.npcWorldX) < 120;
|
||||
return Math.abs(playerWorldX - this.state.npcWorldX) < 60;
|
||||
}
|
||||
|
||||
_talkToNPC() {
|
||||
|
||||
Reference in new issue
Block a user