Time-based difficulty scaling with object pools and bird pooper restart improvements to the minigame

This commit is contained in:
Michal Pikulski
2025-12-16 23:21:10 +01:00
parent 0ff3fbbc70
commit 6133caec53
14 changed files with 994 additions and 280 deletions

View File

@@ -1,4 +1,5 @@
using AppleHills.Core.Settings;
using Minigames.BirdPooper;
using UnityEngine;
namespace Core.Settings
@@ -33,8 +34,8 @@ namespace Core.Settings
[Tooltip("Obstacle scroll speed in units/s")]
[SerializeField] private float obstacleMoveSpeed = 5f;
[Tooltip("Time between obstacle spawns in seconds")]
[SerializeField] private float obstacleSpawnInterval = 2f;
[Tooltip("Obstacle spawning configuration (pools, timing, difficulty)")]
[SerializeField] private ObstacleSpawnConfig obstacleSpawnConfiguration;
[Tooltip("X position where obstacles spawn (off-screen right)")]
[SerializeField] private float obstacleSpawnXPosition = 12f;
@@ -71,7 +72,7 @@ namespace Core.Settings
public float MaxRotationAngle => maxRotationAngle;
public float RotationSpeed => rotationSpeed;
public float ObstacleMoveSpeed => obstacleMoveSpeed;
public float ObstacleSpawnInterval => obstacleSpawnInterval;
public ObstacleSpawnConfig ObstacleSpawnConfiguration => obstacleSpawnConfiguration;
public float ObstacleSpawnXPosition => obstacleSpawnXPosition;
public float ObstacleDestroyXPosition => obstacleDestroyXPosition;
public float ObstacleMinSpawnY => obstacleMinSpawnY;
@@ -91,9 +92,14 @@ namespace Core.Settings
maxFallSpeed = Mathf.Max(0f, maxFallSpeed);
maxRotationAngle = Mathf.Clamp(maxRotationAngle, 0f, 90f);
rotationSpeed = Mathf.Max(0.1f, rotationSpeed);
obstacleSpawnInterval = Mathf.Max(0.1f, obstacleSpawnInterval);
targetMoveSpeed = Mathf.Max(0.1f, targetMoveSpeed);
targetSpawnInterval = Mathf.Max(0.1f, targetSpawnInterval);
// Validate obstacle spawn configuration
if (obstacleSpawnConfiguration != null)
{
obstacleSpawnConfiguration.Validate();
}
}
}
}

View File

@@ -1,8 +1,10 @@
namespace Core.Settings
using Minigames.BirdPooper;
namespace Core.Settings
{
/// <summary>
/// Settings interface for Bird Pooper minigame.
/// Accessed via GameManager.GetSettingsObject<IBirdPooperSettings>()
/// Accessed via GameManager.GetSettingsObject of IBirdPooperSettings
/// </summary>
public interface IBirdPooperSettings
{
@@ -19,12 +21,14 @@
// Obstacles
float ObstacleMoveSpeed { get; }
float ObstacleSpawnInterval { get; }
float ObstacleSpawnXPosition { get; }
float ObstacleDestroyXPosition { get; }
float ObstacleMinSpawnY { get; }
float ObstacleMaxSpawnY { get; }
// Obstacle Spawning Configuration
ObstacleSpawnConfig ObstacleSpawnConfiguration { get; }
// Poop Projectile
float PoopFallSpeed { get; }
float PoopDestroyYPosition { get; }