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>
38 lines
929 B
C#
38 lines
929 B
C#
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);
|
|
}
|
|
}
|
|
}
|