Fixed difficulty stuff
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user