Files
rshtirmer 695a6ebe84 feat(barn-defense): upgrade to retina/DPR template patterns
Upgrade the barn-defense example to use the new high-DPI rendering
architecture from the Phaser 2D template, ensuring crisp rendering on
retina displays and proper responsive scaling across all screen sizes.

Key changes:
- Constants.js: Add DPR/PX canvas sizing, scale all spatial values
  (sizes, speeds, ranges, radii) by PX factor while preserving game
  logic values (HP, damage, costs, durations)
- GameConfig.js: Add Scale.FIT, CENTER_BOTH, zoom: 1/DPR, roundPixels,
  antialias, preserveDrawingBuffer
- index.html: Responsive viewport (max-scale=1, no user-scale),
  fullscreen game container
- main.js: Add render_game_to_text() and advanceTime(ms) test hooks
- PixelRenderer.js: Round canvas dimensions for fractional PX scales,
  use floor/ceil pixel rendering to avoid sub-pixel gaps
- All sprites (tiles, enemies, towers, projectiles): Scale by PX
- All scenes: PX-scale hardcoded offsets for text, buttons, particles
- All UI components: PX-scale button sizes, spacing, fonts, info panels
- All systems: PX-scale particle effects, path markers, barn drawing
- Grid math preserved: TILE_SIZE = 40*PX, GRID_COLS/ROWS unchanged

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-23 16:53:01 -05:00
..