Centre player and NPC vertically on dirt path

This commit is contained in:
justin committed 2026-05-14 10:44:57 -07:00
1 parent fd770c973c
commit 9802427340
1 file changed
+5 -5
+5 -5
View File
@@ -205,7 +205,7 @@ class Game {
const p = document.getElementById('map-player'); const p = document.getElementById('map-player');
if (p) { if (p) {
const centreX = viewW / 2 - 20; const centreX = viewW / 2 - 20;
const centreY = viewH * 0.63 + this.state.worldY; const centreY = viewH * 0.57 + this.state.worldY;
p.style.left = centreX + 'px'; p.style.left = centreX + 'px';
p.style.bottom = (viewH - centreY - 40) + 'px'; p.style.bottom = (viewH - centreY - 40) + 'px';
p.className = `map-player walk-${dir}`; p.className = `map-player walk-${dir}`;
@@ -228,7 +228,7 @@ class Game {
if (npcWrap) { if (npcWrap) {
const screenX = this.state.npcWorldX - this.state.worldX; const screenX = this.state.npcWorldX - this.state.worldX;
npcWrap.style.left = (screenX - 24) + 'px'; npcWrap.style.left = (screenX - 24) + 'px';
npcWrap.style.bottom = (viewH * 0.30) + 'px'; npcWrap.style.bottom = (viewH * 0.36) + 'px';
} }
} }
@@ -245,7 +245,7 @@ class Game {
if (hint) { if (hint) {
hint.style.display = near ? 'block' : 'none'; hint.style.display = near ? 'block' : 'none';
hint.style.left = (viewW / 2 - 28) + 'px'; hint.style.left = (viewW / 2 - 28) + 'px';
hint.style.bottom = (viewH * 0.44) + 'px'; hint.style.bottom = (viewH * 0.50) + 'px';
} }
if (bub) bub.style.opacity = near ? '0' : '1'; if (bub) bub.style.opacity = near ? '0' : '1';
this._updateDirArrow(near); this._updateDirArrow(near);
@@ -262,7 +262,7 @@ class Game {
arrow.textContent = npcScreenX >= viewW / 2 ? '▶' : '◀'; arrow.textContent = npcScreenX >= viewW / 2 ? '▶' : '◀';
arrow.style.display = 'block'; arrow.style.display = 'block';
arrow.style.left = (viewW / 2 + 30) + 'px'; arrow.style.left = (viewW / 2 + 30) + 'px';
arrow.style.bottom = (viewH * 0.42) + 'px'; arrow.style.bottom = (viewH * 0.48) + 'px';
} }
_nearNPC() { _nearNPC() {
@@ -287,7 +287,7 @@ class Game {
const p = document.getElementById('map-player'); const p = document.getElementById('map-player');
if (p) { if (p) {
p.style.left = (viewW / 2 - 20) + 'px'; p.style.left = (viewW / 2 - 20) + 'px';
p.style.bottom = (viewH * 0.30) + 'px'; p.style.bottom = (viewH * 0.36) + 'px';
p.style.transform = 'scaleX(-1)'; p.style.transform = 'scaleX(-1)';
p.className = 'map-player idle'; p.className = 'map-player idle';
} }