Skip to content

Add SEO files and implement grid-based enemy movement system#144

Merged
Azuretier merged 2 commits intomainfrom
claude/block-grid-system-OeKTK
Feb 10, 2026
Merged

Add SEO files and implement grid-based enemy movement system#144
Azuretier merged 2 commits intomainfrom
claude/block-grid-system-OeKTK

Conversation

@Azuretier
Copy link
Owner

Summary

This PR adds SEO infrastructure (robots.txt and sitemap.xml) and refactors the tower defense enemy movement system from continuous physics-based movement to a discrete grid-based system with orthogonal-only movement.

Key Changes

SEO Infrastructure

  • Added public/robots.txt with crawler directives (disallowing /api/, /admin/, /images/, /net*) and sitemap reference
  • Added public/sitemap.xml with four main routes (blog, shader-demo, sns-widgets, sunphase) marked for daily crawling

Tower Defense Grid System

  • New grid constants in constants.ts:

    • GRID_TILE_SIZE: World units per grid tile (1 unit)
    • GRID_HALF: Grid extends ±18 tiles from center
    • GRID_SPAWN_RING: Enemies spawn at Manhattan distance 18 from tower
    • GRID_TOWER_RADIUS: Enemy reaches tower at Manhattan distance ≤ 1
  • Enemy type updates in types.ts:

    • Added gridX and gridZ properties for discrete grid coordinates
    • World-space x, y, z are now derived from grid coords for rendering
  • Movement system refactor in useGameState.ts:

    • Enemies now move 1 tile per turn on a discrete grid (orthogonal only: Up/Down/Left/Right)
    • spawnEnemies(): Spawns enemies on the perimeter at Manhattan distance = 18, with collision avoidance
    • updateEnemies(): Implements pathfinding using Manhattan distance; enemies pick the best cardinal direction that reduces distance to tower, avoiding occupied cells
    • Processes enemies closest to tower first to give priority on cell claims
    • killEnemies() and fireBullet(): Updated to use Manhattan distance for targeting priority

Implementation Details

  • Enemies are processed in order of proximity to tower during movement to ensure fair cell allocation
  • Directions are shuffled to break ties randomly, preventing predictable movement patterns
  • Collision avoidance prevents multiple enemies from occupying the same grid cell
  • Grid coordinates are converted to world space (multiply by GRID_TILE_SIZE) for 3D rendering

https://claude.ai/code/session_01B1pGw7pTLFLwYhHVKFJig2

Standardize enemy movement to a discrete tile grid with orthogonal-only
movement (Up/Down/Left/Right) at 1 tile per turn. This makes enemy
pathing predictable and allows players to forecast threats by tile distance.

- Add gridX/gridZ coordinates to Enemy type and GridPos helper type
- Add grid constants (GRID_TILE_SIZE, GRID_HALF, GRID_SPAWN_RING, GRID_TOWER_RADIUS)
- Rewrite spawnEnemies to place on Manhattan-distance perimeter cells
- Rewrite updateEnemies for orthogonal greedy pathfinding with collision avoidance
- Update killEnemies and fireBullet to use Manhattan distance

https://claude.ai/code/session_01B1pGw7pTLFLwYhHVKFJig2
@vercel
Copy link
Contributor

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
azuretier.net Ready Ready Preview, Comment Feb 10, 2026 4:51am

Request Review

@Azuretier Azuretier merged commit af063f3 into main Feb 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants