Add SEO files and implement grid-based enemy movement system#144
Merged
Add SEO files and implement grid-based enemy movement system#144
Conversation
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
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
public/robots.txtwith crawler directives (disallowing/api/,/admin/,/images/,/net*) and sitemap referencepublic/sitemap.xmlwith four main routes (blog, shader-demo, sns-widgets, sunphase) marked for daily crawlingTower 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 centerGRID_SPAWN_RING: Enemies spawn at Manhattan distance 18 from towerGRID_TOWER_RADIUS: Enemy reaches tower at Manhattan distance ≤ 1Enemy type updates in
types.ts:gridXandgridZproperties for discrete grid coordinatesx,y,zare now derived from grid coords for renderingMovement system refactor in
useGameState.ts:spawnEnemies(): Spawns enemies on the perimeter at Manhattan distance = 18, with collision avoidanceupdateEnemies(): Implements pathfinding using Manhattan distance; enemies pick the best cardinal direction that reduces distance to tower, avoiding occupied cellskillEnemies()andfireBullet(): Updated to use Manhattan distance for targeting priorityImplementation Details
GRID_TILE_SIZE) for 3D renderinghttps://claude.ai/code/session_01B1pGw7pTLFLwYhHVKFJig2