🐛 fix Nisse outline only shown when actually occluded
Silhouette now hidden by default and toggled on per frame only when isOccluded() detects a tree, rock or building 1–3 tiles below the Nisse. Adds WorldSystem.hasResourceAt() for O(1) tile lookup. Outline colour changed to light blue (0xaaddff) at scale 1.1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -172,6 +172,16 @@ export class WorldSystem {
|
||||
this.resourceTiles.delete(tileY * WORLD_TILES + tileX)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if a resource (tree or rock) occupies the given tile.
|
||||
* Uses the O(1) resourceTiles index.
|
||||
* @param tileX - Tile column
|
||||
* @param tileY - Tile row
|
||||
*/
|
||||
hasResourceAt(tileX: number, tileY: number): boolean {
|
||||
return this.resourceTiles.has(tileY * WORLD_TILES + tileX)
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts world pixel coordinates to tile coordinates.
|
||||
* @param worldX - World X in pixels
|
||||
|
||||
Reference in New Issue
Block a user