A nice amount of difficulty increase

This commit is contained in:
BOT Alex 2024-02-04 07:16:08 +01:00
parent 4c1ad8e585
commit d6ee4f477a
1 changed files with 3 additions and 7 deletions

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Unity.Mathematics;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.AI;
@ -16,8 +17,7 @@ public class EnemySpawner : MonoBehaviour
public float difficulty = 1f;
// Inspector
[SerializeField] private float difficultyIncreasePerWave = 0.1f;
[SerializeField] private float difficultyMultiplyDecreasePerWave = 0.1f;
[SerializeField] private float difficultyIncreasePerWave = 1f;
[SerializeField] private float WaveTime = 20f;
[SerializeField] private List<float> enemyDifficulties;
[SerializeField] private float SpawnRadius = 10;
@ -61,11 +61,7 @@ public class EnemySpawner : MonoBehaviour
SpawnWave(difficulty);
Wave++;
if (difficultyIncreasePerWave > 1f)
{
difficultyIncreasePerWave -= difficultyMultiplyDecreasePerWave;
difficulty *= difficultyIncreasePerWave + 1;
}
difficulty *= MathF.Cbrt(difficultyIncreasePerWave);
nextWaveRequested = false;
timer = 0;
}