feat(grid): Replace real-time CTF with turn-based grid system

Replace continuous free-form movement with discrete 20x50 grid-based
gameplay featuring asymmetric movement mechanics:

- Blue/Red teams with 3 units each
- Zone-based movement: orthogonal (4 dir) in offense, diagonal (8 dir) in defense
- Alternating turns with click-to-select, click-to-move input
- Fog of war: 3-cell Chebyshev vision radius per unit
- Defense speed nerf: skip every 4th move in own zone
- AI opponent that chases flag carriers and advances toward enemy flag
- Collision resolution: defender wins in their zone, lower ID wins in neutral

Implements all 3 phases from the plan:
- Phase 1: Playable grid with hot-seat two-player
- Phase 2: Fog of war + defense speed nerf
- Phase 3: AI opponent

Deleted obsolete files: Flag.cs, Unit.cs, RouteDrawer.cs, SimpleAI.cs, Visibility.cs

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
John Lamb
2026-02-07 17:05:44 -06:00
parent 0de174eb1a
commit e4ac24f989
17 changed files with 1658 additions and 1092 deletions

View File

@@ -0,0 +1,37 @@
using UnityEngine;
public enum Team { Blue, Red }
public class GridUnit
{
public int UnitId;
public Team Team;
public Vector2Int GridPosition;
public int ConsecutiveDefenseMoves;
public bool IsTaggedOut;
public int RespawnTurnsRemaining;
// Visual representation
public GameObject GameObject;
public SpriteRenderer SpriteRenderer;
public GridUnit(int unitId, Team team, Vector2Int position, GameObject go)
{
UnitId = unitId;
Team = team;
GridPosition = position;
ConsecutiveDefenseMoves = 0;
IsTaggedOut = false;
RespawnTurnsRemaining = 0;
GameObject = go;
SpriteRenderer = go.GetComponent<SpriteRenderer>();
}
public void SetWorldPosition(Vector2 worldPos)
{
if (GameObject != null)
{
GameObject.transform.position = new Vector3(worldPos.x, worldPos.y, 0);
}
}
}