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