Lower player and NPC to centre of dirt path
This commit is contained in:
1 parent
28068c7aa8
commit
478944b8b6
1 file changed
+4
-4
@@ -385,7 +385,7 @@ class Game {
|
|||||||
const p = document.getElementById('map-player');
|
const p = document.getElementById('map-player');
|
||||||
if (p) {
|
if (p) {
|
||||||
const centreX = viewW / 2 - 16;
|
const centreX = viewW / 2 - 16;
|
||||||
const centreY = viewH * 0.57 + this.state.worldY;
|
const centreY = viewH * 0.65 + 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}`;
|
||||||
@@ -408,7 +408,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.36) + 'px';
|
npcWrap.style.bottom = (viewH * 0.28) + 'px';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ class Game {
|
|||||||
arrow.textContent = '▶';
|
arrow.textContent = '▶';
|
||||||
arrow.style.display = 'block';
|
arrow.style.display = 'block';
|
||||||
arrow.style.removeProperty('left');
|
arrow.style.removeProperty('left');
|
||||||
arrow.style.bottom = (viewH * 0.36) + 'px';
|
arrow.style.bottom = (viewH * 0.28) + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
_nearNPC() {
|
_nearNPC() {
|
||||||
@@ -466,7 +466,7 @@ class Game {
|
|||||||
const p = document.getElementById('map-player');
|
const p = document.getElementById('map-player');
|
||||||
if (p) {
|
if (p) {
|
||||||
p.style.left = (viewW / 2 - 16) + 'px';
|
p.style.left = (viewW / 2 - 16) + 'px';
|
||||||
p.style.bottom = (viewH * 0.36) + 'px';
|
p.style.bottom = (viewH * 0.28) + 'px';
|
||||||
|
|
||||||
p.className = 'map-player idle';
|
p.className = 'map-player idle';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user