Esempio n. 1
0
        public static void Update()
        {
            if (!PlayerShip.Instance.IsDead && EntityManager.Count < 200)
            {
                if (rand.Next(1, 500) == 1)
                {
                    EntityManager.Add(Speed.CreateSpeed(GetSpawnPosition()));
                }
                if (rand.Next(1, 250) == 1)
                {
                    EntityManager.Add(Ammo.CreateAmmo(GetSpawnPosition()));
                }
                if (rand.Next((int)inverseSpawnChance) == 0)
                {
                    EntityManager.Add(Enemy.CreateSeeker(GetSpawnPosition()));
                }
                if (rand.Next(1, 2) == 1 && GameRoot.state3 == true && Count < 1)
                {
                    Count = Count + 1;
                    EntityManager.Add(Bosses.CreateBosses(GetSpawnPosition()));
                }
            }

            // slowly increase the spawn rate as time progresses
            if (inverseSpawnChance > 20)
            {
                inverseSpawnChance -= 0.005f;
            }
            if (ammoChance > 20)
            {
                ammoChance -= 0.5f;
            }
        }
Esempio n. 2
0
        public static void Update()
        {
            if (!PlayerShip.Instance.IsDead && EntityManager.Count < 200)
            {
                if (rand.Next((int)inverseSpawnChance) == 0)
                {
                    EntityManager.Add(Enemy.CreateSeeker(GetSpawnPosition()));
                }
            }

            // slowly increase the spawn rate as time progresses
            if (inverseSpawnChance > 20)
            {
                inverseSpawnChance -= 0.005f;
            }
        }
Esempio n. 3
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;
            }
        }
Esempio n. 4
0
        private static void levelSpawner()
        {
            int randEnemySpawn = rand.Next(1, 3);

            //Level 1
            if (!PlayerShip.Instance.IsDead && EntityManager.Count < 200)
            {
                if (rand.Next((int)inverseSpawnChance) == 0 && PlayerShip.Instance.level != 4)
                {
                    EntityManager.Add(Enemy.CreateSeeker(GetSpawnPosition()));
                }
                else if (rand.Next((int)inverseSpawnChance) == 10 && PlayerShip.Instance.level == 2)
                {
                    //Level 2
                    EntityManager.Add(Enemy.CreateStraightLineEnemy(GetSpawnPosition()));
                }

                else if (rand.Next((int)inverseSpawnChance) == 10 && PlayerShip.Instance.level == 3)
                {
                    Console.WriteLine("Random Enemy: " + randEnemySpawn);
                    //Level 3
                    switch (randEnemySpawn)
                    {
                    case 1:
                        EntityManager.Add(Enemy.CreateStraightLineEnemy(GetSpawnPosition()));
                        Console.WriteLine("Random Enemy: " + randEnemySpawn);
                        break;

                    case 2:
                        EntityManager.Add(Enemy.CreateStraightLineEnemyLeft(GetSpawnPositionRightSide()));
                        EntityManager.Add(Enemy.CreateStraightLineEnemyLeft(GetSpawnPositionRightSide()));
                        break;
                    }
                }
                //Final Level
                else if (rand.Next((int)inverseSpawnChance) == 10 && PlayerShip.Instance.level == 4)
                {
                    if (PlayerShip.Instance.bossSpawned == false)
                    {
                        EntityManager.Add(Enemy.CreateBoss(bossSpawnPos));
                    }

                    switch (randEnemySpawn)
                    {
                    case 1:
                        EntityManager.Add(Enemy.CreateStraightLineEnemy(GetSpawnPosition()));
                        break;

                    case 2:
                        EntityManager.Add(Enemy.CreateStraightLineEnemyLeft(GetSpawnPositionRightSide()));
                        break;

                    case 3:
                        EntityManager.Add(Enemy.CreateStraightLineEnemyRight(GetSpawnPositionLeftSide()));
                        break;
                    }
                }
            }
            // slowly increase the spawn rate as time progresses
            if (inverseSpawnChance > 20)
            {
                inverseSpawnChance -= 0.01f;
            }
        }