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