Move _generateTrees() to after npcWorldX is set so trees span the full path
This commit is contained in:
@@ -1031,7 +1031,6 @@ class Game {
|
|||||||
|
|
||||||
/* We need the viewport size — defer a tick so the DOM is laid out */
|
/* We need the viewport size — defer a tick so the DOM is laid out */
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
this._generateTrees();
|
|
||||||
const world = document.getElementById('map-inner');
|
const world = document.getElementById('map-inner');
|
||||||
const viewW = world ? world.parentElement.offsetWidth : 420;
|
const viewW = world ? world.parentElement.offsetWidth : 420;
|
||||||
|
|
||||||
@@ -1049,6 +1048,8 @@ class Game {
|
|||||||
this.state.npcWorldY = 0;
|
this.state.npcWorldY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._generateTrees();
|
||||||
|
|
||||||
document.getElementById('hud-name').textContent = this.state.playerName||'ASH';
|
document.getElementById('hud-name').textContent = this.state.playerName||'ASH';
|
||||||
this.updateHUD();
|
this.updateHUD();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user