Пример #1
0
        public static void Update()
        {
            if (!PlayerShip.Instance.IsDead && EntityManager.Count < 200)
            {
                if (rand.Next((int)inverseSpawnChance) == 0)
                {
                    EntityManager.Add(Enemy.CreateSeeker3(GetSpawnPosition()));
                }
            }

            // slowly increase the spawn rate as time progresses
            if (inverseSpawnChance > 1)
            {
                inverseSpawnChance -= 0.005f;
            }
        }
Пример #2
0
        public static void Update()
        {
            if (GameRoot.gameState == GameRoot.GameState.LevelTwo || GameRoot.gameState == GameRoot.GameState.LevelOne)
            {
                if (!PlayerShip.Instance.IsDead && EntityManager.Count < 200)
                {
                    if (rand.Next((int)inverseSpawnChance) == 0)
                    {
                        EntityManager.Add(Enemy.CreateSeeker(GetSpawnPosition()));
                    }
                }
            }

            if (GameRoot.gameState == GameRoot.GameState.LevelTwo || GameRoot.gameState == GameRoot.GameState.LevelThree)
            {
                if (!PlayerShip.Instance.IsDead && EntityManager.Count < 200)
                {
                    if (rand.Next((int)inverseSpawnChance) == 0)
                    {
                        EntityManager.Add(Enemy.CreateSeeker2(GetSpawnPosition()));
                    }
                }
            }

            if (GameRoot.gameState == GameRoot.GameState.LevelThree)
            {
                if (EntityManager.Score >= 5000 && EntityManager.Score <= 11000)
                {
                    EntityManager.Add(Enemy.CreateSeeker3(BossSpawnPosition()));
                }
            }

            // slowly increase the spawn rate as time progresses
            if (inverseSpawnChance > 20)
            {
                inverseSpawnChance -= 0.005f;
            }
        }