Adding 9 Player level

This commit is contained in:
Matt F 2026-05-21 23:36:19 -07:00
parent fdada6f132
commit a7be12fa9b
30 changed files with 45984 additions and 300 deletions

View file

@ -470,13 +470,13 @@ namespace TD.Gameplay
{
Vector3 builderXZ = new Vector3(transform.position.x, 0f, transform.position.z);
// Find the point on the footprint rectangle nearest to the builder.
float minX = anchor.x * GridCoordinates.TILE_SIZE - GridCoordinates.TILE_SIZE * 0.5f;
float maxX = (anchor.x + footprintSize.x - 1) * GridCoordinates.TILE_SIZE
+ GridCoordinates.TILE_SIZE * 0.5f;
float minZ = anchor.y * GridCoordinates.TILE_SIZE - GridCoordinates.TILE_SIZE * 0.5f;
float maxZ = (anchor.y + footprintSize.y - 1) * GridCoordinates.TILE_SIZE
+ GridCoordinates.TILE_SIZE * 0.5f;
// Find the point on the footprint rectangle nearest to the builder. Tile N spans
// world [N, N+1] (edge-aligned), so a footprint at anchor (ax, ay) with size (sx, sy)
// spans world [ax, ax+sx] × [ay, ay+sy].
float minX = anchor.x * GridCoordinates.TILE_SIZE;
float maxX = (anchor.x + footprintSize.x) * GridCoordinates.TILE_SIZE;
float minZ = anchor.y * GridCoordinates.TILE_SIZE;
float maxZ = (anchor.y + footprintSize.y) * GridCoordinates.TILE_SIZE;
float nearestX = Mathf.Clamp(builderXZ.x, minX, maxX);
float nearestZ = Mathf.Clamp(builderXZ.z, minZ, maxZ);