✨ fix depth sorting for world objects by tileY
Fixes #31. All trees, rocks, seedlings and buildings now use tileY+5 as depth instead of a fixed value, so objects further down the screen always render in front of objects above them regardless of spawn order. Build ghost moved to depth 1000/1001. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -110,7 +110,7 @@ export class TreeSeedlingSystem {
|
||||
const key = `seedling_${Math.min(s.stage, 2)}`
|
||||
const sprite = this.scene.add.image(x, y, key)
|
||||
.setOrigin(0.5, 0.85)
|
||||
.setDepth(5)
|
||||
.setDepth(s.tileY + 5)
|
||||
this.sprites.set(s.id, sprite)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user