Fix player and NPC vertical position to sit on the dirt path instead of the grass
This commit is contained in:
1 parent
2213a85ff8
commit
b81958a56d
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.45 + this.state.worldY;
|
const centreY = viewH * 0.60 + 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}`;
|
||||||
@@ -233,7 +233,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.56) + 'px';
|
hint.style.bottom = (viewH * 0.46) + 'px';
|
||||||
}
|
}
|
||||||
if (bub) bub.style.opacity = near ? '0' : '1';
|
if (bub) bub.style.opacity = near ? '0' : '1';
|
||||||
this._updateDirArrow(near);
|
this._updateDirArrow(near);
|
||||||
@@ -250,7 +250,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.50) + 'px';
|
arrow.style.bottom = (viewH * 0.40) + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
_nearNPC() {
|
_nearNPC() {
|
||||||
@@ -275,14 +275,14 @@ 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.42) + 'px';
|
p.style.bottom = (viewH * 0.32) + 'px';
|
||||||
p.style.transform = 'scaleX(-1)';
|
p.style.transform = 'scaleX(-1)';
|
||||||
p.className = 'map-player idle';
|
p.className = 'map-player idle';
|
||||||
}
|
}
|
||||||
const npcWrap = document.getElementById('map-npc-wrap');
|
const npcWrap = document.getElementById('map-npc-wrap');
|
||||||
if (npcWrap) {
|
if (npcWrap) {
|
||||||
npcWrap.style.left = (this.state.npcWorldX - 24) + 'px';
|
npcWrap.style.left = (this.state.npcWorldX - 24) + 'px';
|
||||||
npcWrap.style.bottom = (viewH * 0.42) + 'px';
|
npcWrap.style.bottom = (viewH * 0.32) + 'px';
|
||||||
}
|
}
|
||||||
this._applyCamera();
|
this._applyCamera();
|
||||||
const hint = document.getElementById('map-talk-hint');
|
const hint = document.getElementById('map-talk-hint');
|
||||||
|
|||||||
Reference in new issue
Block a user