Update card sorting MVP

This commit is contained in:
Michal Pikulski
2025-11-19 23:47:43 +01:00
parent b2c61125ef
commit 6b8420c8c7
22 changed files with 1010 additions and 244 deletions

View File

@@ -55,10 +55,24 @@ namespace Core.Settings
[Tooltip("Points deducted when item falls off belt")]
[SerializeField] private int missedItemPenalty = -3;
[Header("Lives")]
[Tooltip("Maximum number of lives player has")]
[SerializeField] private int maxLives = 3;
[Header("Rewards")]
[Tooltip("Booster packs awarded per correct sort")]
[SerializeField] private int boosterPacksPerCorrectItem = 1;
[Header("Visual")]
[Tooltip("Size of spawned cards (width, height)")]
[SerializeField] private Vector2 cardSize = new Vector2(100f, 140f);
[Tooltip("Random offset range for spawn distance X (min, max). Range: -10 to 10")]
[SerializeField] private Vector2 spawnOffsetX = new Vector2(-5f, 5f);
[Tooltip("Random offset range for spawn Y position (min, max). Range: -10 to 10")]
[SerializeField] private Vector2 spawnOffsetY = new Vector2(-10f, 10f);
// Interface implementation
public float GameDuration => gameDuration;
@@ -75,7 +89,11 @@ namespace Core.Settings
public int CorrectSortPoints => correctSortPoints;
public int IncorrectSortPenalty => incorrectSortPenalty;
public int MissedItemPenalty => missedItemPenalty;
public int MaxLives => maxLives;
public int BoosterPacksPerCorrectItem => boosterPacksPerCorrectItem;
public Vector2 CardSize => cardSize;
public Vector2 SpawnOffsetX => spawnOffsetX;
public Vector2 SpawnOffsetY => spawnOffsetY;
public override void OnValidate()
{
@@ -86,6 +104,15 @@ namespace Core.Settings
maxBeltSpeed = Mathf.Max(initialBeltSpeed, maxBeltSpeed);
correctSortPoints = Mathf.Max(0, correctSortPoints);
boosterPacksPerCorrectItem = Mathf.Max(0, boosterPacksPerCorrectItem);
maxLives = Mathf.Max(1, maxLives);
cardSize.x = Mathf.Max(1f, cardSize.x);
cardSize.y = Mathf.Max(1f, cardSize.y);
// Clamp spawn offsets between -10 and 10
spawnOffsetX.x = Mathf.Clamp(spawnOffsetX.x, -10f, 10f);
spawnOffsetX.y = Mathf.Clamp(spawnOffsetX.y, -10f, 10f);
spawnOffsetY.x = Mathf.Clamp(spawnOffsetY.x, -10f, 10f);
spawnOffsetY.y = Mathf.Clamp(spawnOffsetY.y, -10f, 10f);
}
}
}

View File

@@ -32,8 +32,16 @@ namespace Core.Settings
int IncorrectSortPenalty { get; }
int MissedItemPenalty { get; }
// Lives
int MaxLives { get; }
// Rewards
int BoosterPacksPerCorrectItem { get; }
// Visual
Vector2 CardSize { get; }
Vector2 SpawnOffsetX { get; } // Min/Max range for X offset (distance)
Vector2 SpawnOffsetY { get; } // Min/Max range for Y offset (position)
}
}