From 27e3f70e383c5116f87f8377b8385e94c2f3f32c Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Tue, 27 Jan 2026 09:46:22 +0000 Subject: [PATCH] Fixed difficulty stuff --- Assets/Scripts/DifficultyManager.cs | 2 +- Assets/Scripts/ScoreTracker.cs | 4 ++-- Assets/Scripts/WindowSpawner.cs | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/DifficultyManager.cs b/Assets/Scripts/DifficultyManager.cs index cb46d31..208481f 100644 --- a/Assets/Scripts/DifficultyManager.cs +++ b/Assets/Scripts/DifficultyManager.cs @@ -5,7 +5,7 @@ namespace InterfaceOff.MainMenu { public class DifficultyManager : MonoBehaviour { - public static float DifficultyMultiplier { get; private set; } = 1; + public static float DifficultyMultiplier { get; private set; } = 0.75f; public static float DifficultyEffect => Mathf.Pow(f: DifficultyMultiplier, p: 2); [SerializeField] private Slider DifficultySlider; diff --git a/Assets/Scripts/ScoreTracker.cs b/Assets/Scripts/ScoreTracker.cs index b2436f8..8da10db 100644 --- a/Assets/Scripts/ScoreTracker.cs +++ b/Assets/Scripts/ScoreTracker.cs @@ -37,8 +37,8 @@ namespace InterfaceOff.WorldScene private string CurrentPlayerName { get; set; } = string.Empty; private bool StoredCurrentScore = false; private float Score; - - #if UNITY_STANDALONE_WIN + +#if UNITY_STANDALONE_WIN [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] private static void OnStart() diff --git a/Assets/Scripts/WindowSpawner.cs b/Assets/Scripts/WindowSpawner.cs index cf17b0f..ef977e6 100644 --- a/Assets/Scripts/WindowSpawner.cs +++ b/Assets/Scripts/WindowSpawner.cs @@ -104,13 +104,15 @@ namespace InterfaceOff int currentMaxSpawnTime = MAX_SPAWN_TIME - (int)(ScoreTracker.CurrentScore() * DifficultyManager.DifficultyEffect); currentMaxSpawnTime = Math.Clamp(currentMaxSpawnTime, MIN_SPAWN_TIME + 1, MAX_SPAWN_TIME); + + Debug.Log($"Max: [{currentMaxSpawnTime}] with difficulty [{DifficultyManager.DifficultyEffect}]"); /* Decreases the spawn counter and spawns if at 0 */ TimeTillNextSpawn = Math.Max(0, TimeTillNextSpawn - 1); if (TimeTillNextSpawn == 0) { float difficulty = DifficultyManager.DifficultyMultiplier; - TimeTillNextSpawn = Random.Range((int)(MIN_SPAWN_TIME * difficulty), (int)(currentMaxSpawnTime * difficulty)); + TimeTillNextSpawn = Random.Range((int)(MIN_SPAWN_TIME * difficulty), (int)(currentMaxSpawnTime / difficulty)); SpawnNewRandomWindow(); } }