public static void Update() { if (!PlayerShip.Instance.IsDead && EntityManager.Count < 10) { if (rand.Next((int)inverseSpawnChance) == 0) { EntityManager.Add(Enemy.CreateEnemy(GetSpawnPosition())); if (rand.NextDouble() * 1 > 0.9) { EntityManager.Add(Enemy.CreateEnemyRare(GetSpawnPosition())); } } // slowly increase the spawn rate as time progresses if (inverseSpawnChance > 20) { inverseSpawnChance -= 0.005f; } } }