Nudge player and NPC up to sit visibly on the dirt path
This commit is contained in:
1 parent
34a9bae50c
commit
fd770c973c
1 file changed
+5
-5
@@ -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.75 + this.state.worldY;
|
const centreY = viewH * 0.63 + 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.18) + 'px';
|
npcWrap.style.bottom = (viewH * 0.30) + '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.32) + 'px';
|
hint.style.bottom = (viewH * 0.44) + '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.28) + 'px';
|
arrow.style.bottom = (viewH * 0.42) + '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.18) + 'px';
|
p.style.bottom = (viewH * 0.30) + 'px';
|
||||||
p.style.transform = 'scaleX(-1)';
|
p.style.transform = 'scaleX(-1)';
|
||||||
p.className = 'map-player idle';
|
p.className = 'map-player idle';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user