fix(map): landscape orientation with left/right bases

- Map now 38x18 (19:9 landscape aspect ratio)
- Player base on left, enemy base on right
- Houses repositioned for horizontal play lanes
- Unit spawn offsets adjusted for horizontal layout

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
John Lamb
2026-02-01 21:37:05 -06:00
parent 3fc62cde24
commit c4b3507272

View File

@@ -37,9 +37,9 @@ public class Game : MonoBehaviour
// Scoring
public const int WinScore = 3;
// Map - 9:19 aspect ratio for smartphone (portrait)
public const float MapWidth = 18f;
public const float MapHeight = 38f;
// Map - 19:9 aspect ratio for smartphone (landscape)
public const float MapWidth = 38f;
public const float MapHeight = 18f;
// Bases
public const float BaseSize = 5f;
@@ -104,70 +104,71 @@ public class Game : MonoBehaviour
void CreateObstacles()
{
// Dense house layout creating multiple route choices
// Layout designed for 18x38 map with bases at corners
// Houses create lanes, chokepoints, and flanking routes
// Dense house layout for landscape 38x18 map
// Bases on left/right, houses create horizontal lanes with cross-routes
Vector2[] housePositions = {
// Bottom section (near player base) - create 3 exit routes
new(-4f, -14f),
new(4f, -12f),
new(0f, -10f),
// Left section (near player base) - create 3 exit lanes
new(-14f, 5f),
new(-12f, -4f),
new(-10f, 0f),
// Lower-mid section - force route decisions
new(-6f, -6f),
new(-2f, -4f),
new(3f, -7f),
new(6f, -3f),
// Left-mid section - force route decisions
new(-6f, 6f),
new(-4f, 2f),
new(-7f, -3f),
new(-3f, -5f),
// Center section - dense, creates cat-and-mouse area
new(-5f, 2f),
new(-1f, 0f),
new(2f, 3f),
new(5f, -1f),
new(0f, 5f),
new(2f, 5f),
new(0f, 1f),
new(-2f, -2f),
new(3f, -4f),
new(-1f, -6f),
new(1f, 6f),
// Upper-mid section - mirror complexity
new(-6f, 8f),
new(-2f, 10f),
new(4f, 7f),
new(6f, 11f),
// Right-mid section - mirror complexity
new(6f, 5f),
new(4f, -2f),
new(7f, -5f),
new(5f, 2f),
// Top section (near enemy base) - create 3 approach routes
new(-4f, 14f),
new(0f, 12f),
new(5f, 15f),
// Right section (near enemy base) - create 3 approach lanes
new(14f, 4f),
new(12f, -3f),
new(10f, 0f),
};
Vector2[] houseSizes = {
// Bottom section
new(3f, 2.5f),
// Left section
new(2.5f, 3f),
new(3f, 2.5f),
new(2f, 2f),
// Lower-mid
new(2.5f, 3f),
new(3f, 2f),
new(2f, 2.5f),
// Left-mid
new(3f, 2.5f),
new(2f, 3f),
new(2.5f, 2f),
new(2.5f, 2.5f),
// Center - varied sizes for interesting gaps
new(2f, 3f),
new(3f, 2f),
new(2f, 2.5f),
new(2.5f, 2f),
new(2f, 2f),
new(2.5f, 2.5f),
// Right-mid
new(2.5f, 2.5f),
new(3f, 2f),
new(2.5f, 3f),
new(2f, 2f),
// Right section
new(3f, 2.5f),
new(2f, 3f),
new(2.5f, 2f),
new(2f, 2.5f),
new(2f, 2f),
// Upper-mid
new(2.5f, 2.5f),
new(2f, 3f),
new(3f, 2.5f),
new(2f, 2f),
// Top section
new(2.5f, 3f),
new(3f, 2f),
new(2f, 2.5f),
};
for (int i = 0; i < housePositions.Length; i++)
@@ -185,9 +186,9 @@ public class Game : MonoBehaviour
void CreateBases()
{
// Player base - bottom center
// Player base - left side
var playerBaseGO = CreateSprite("PlayerBase", new Color(0.2f, 0.3f, 0.8f, 0.5f), BaseSize, BaseSize);
playerBaseGO.transform.position = new Vector3(0, -MapHeight / 2f + BaseInset, 0);
playerBaseGO.transform.position = new Vector3(-MapWidth / 2f + BaseInset, 0, 0);
playerBase = playerBaseGO.transform;
var sr1 = playerBaseGO.GetComponent<SpriteRenderer>();
sr1.sortingOrder = -8;
@@ -199,9 +200,9 @@ public class Game : MonoBehaviour
var playerBaseZone = playerBaseGO.AddComponent<BaseZone>();
playerBaseZone.team = Unit.Team.Player;
// Enemy base - top center
// Enemy base - right side
var enemyBaseGO = CreateSprite("EnemyBase", new Color(0.8f, 0.2f, 0.2f, 0.5f), BaseSize, BaseSize);
enemyBaseGO.transform.position = new Vector3(0, MapHeight / 2f - BaseInset, 0);
enemyBaseGO.transform.position = new Vector3(MapWidth / 2f - BaseInset, 0, 0);
enemyBase = enemyBaseGO.transform;
var sr2 = enemyBaseGO.GetComponent<SpriteRenderer>();
sr2.sortingOrder = -8;
@@ -273,8 +274,8 @@ public class Game : MonoBehaviour
Vector3 GetUnitSpawnOffset(int index, int total, bool isPlayer)
{
float spacing = 1.8f;
float xOffset = (index - (total - 1) / 2f) * spacing;
float yOffset = isPlayer ? -2f : 2f;
float yOffset = (index - (total - 1) / 2f) * spacing;
float xOffset = isPlayer ? 2f : -2f; // Offset toward center of map
return new Vector3(xOffset, yOffset, 0);
}