fix: player size, unplayable walls, NPC interaction, canvas sizing

- Player sprite: render 32x32 char at 1 tile (TILE_PX) instead of
  2x2 tiles (32*SCALE), matching NPC size on the game grid
- Wall data: completely rebuilt for both lab and town maps based on
  actual PNG layouts. Previous walls blocked spawn point, NPC access,
  and all exits. Now uses Set for O(1) collision lookups
- NPC dialog: was unreachable due to wall layout, causing player to
  interact with workshop tiles instead. Fixed by opening corridors
- Canvas: use window.innerWidth/Height directly instead of
  offsetWidth which gave wrong values before CSS recompute

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jose Luis
2026-03-20 16:19:49 +01:00
parent 75001e10e7
commit 9b2a25856e
3 changed files with 149 additions and 130 deletions

View File

@@ -122,8 +122,9 @@ export function drawPlayer(ctx, screenX, screenY, direction, walkFrame) {
return;
}
ctx.imageSmoothingEnabled = false;
// Character is 32x32 native = 2x2 tiles, draw at SCALE
ctx.drawImage(img, screenX, screenY, 32 * SCALE, 32 * SCALE);
// Character is 32x32 native but represents a 1-tile-wide, 2-tile-tall entity
// Draw at TILE_PX wide x TILE_PX tall (square, matching NPC size on grid)
ctx.drawImage(img, screenX, screenY, TILE_PX, TILE_PX);
}
/**