Esempio n. 1
0
 private void PlayerLocationActivity()
 {
     for (int i = 0; i < EnemySpinnerList.Count; i++)
     {
         EnemySpinner spinner = EnemySpinnerList[i];
         spinner.PlayerLocationX = MainShipInstance.X;
         spinner.PlayerLocationY = MainShipInstance.Y;
     }
 }
Esempio n. 2
0
 private void SpinnerVsPlayerShipCollisionActivity()
 {
     for (int i = EnemySpinnerList.Count - 1; i > -1; i--)
     {
         EnemySpinner spinner = EnemySpinnerList[i];
         if (spinner.Polygon.CollideAgainst(MainShipInstance.Polygon))
         {
             MainShipInstance.HealthPoints -= spinner.Damage;
             spinner.Explode();
         }
     }
 }
Esempio n. 3
0
        private void SpawnEnemies()
        {
            EnemySpinner spinner1 = EnemySpinnerFactory.CreateNew();

            spinner1.EnemyState   = EnemySpinner.VariableState.DarkGrey;
            spinner1.TurningSpeed = 50;
            spinner1.Position     = new Microsoft.Xna.Framework.Vector3(-200, 200, 0);
            EnemyKamikaze kamikaze3 = EnemyKamikazeFactory.CreateNew();

            kamikaze3.Position   = new Microsoft.Xna.Framework.Vector3(200, 200, 0);
            kamikaze3.EnemyState = EnemyKamikaze.VariableState.Purple;
        }
Esempio n. 4
0
        private void DestroyEverything()
        {
            for (int i = AstericeList.Count - 1; i > -1; i--)
            {
                Asterice asterice = AstericeList[i];
                asterice.Destroy();
            }

            for (int i = ExplosionList.Count - 1; i > -1; i--)
            {
                Explosion explosion = ExplosionList[i];
                explosion.Destroy();
            }

            for (int i = MainShipList.Count - 1; i > -1; i--)
            {
                MainShip asterice = MainShipList[i];
                asterice.Destroy();
            }

            for (int i = EnemySpinnerList.Count - 1; i > -1; i--)
            {
                EnemySpinner asterice = EnemySpinnerList[i];
                asterice.Destroy();
            }

            for (int i = EnemyJumperList.Count - 1; i > -1; i--)
            {
                EnemyJumper asterice = EnemyJumperList[i];
                asterice.Destroy();
            }

            for (int i = EnemyKamikazeList.Count - 1; i > -1; i--)
            {
                EnemyKamikaze asterice = EnemyKamikazeList[i];
                asterice.Destroy();
            }

            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                Bullet asterice = BulletList[i];
                asterice.Destroy();
            }

            this.EnemySpawnerInstance.Destroy();
            this.TravelBackgroundInstance.Destroy();
            this.HealthBar.Destroy();
            this.ScoreBar.Destroy();
            this.UnloadsContentManagerWhenDestroyed = true;
        }
Esempio n. 5
0
        private void PlayerLocationActivity()
        {
            for (int i = 0; i < EnemySpinnerList.Count; i++)
            {
                EnemySpinner spinner = EnemySpinnerList[i];
                spinner.PlayerLocationX = MainShipList[0].X;
                spinner.PlayerLocationY = MainShipList[0].Y;
            }

            for (int i = 0; i < EnemyKamikazeList.Count; i++)
            {
                EnemyKamikaze kamikaze = EnemyKamikazeList[i];
                kamikaze.PlayerLocationX = MainShipList[0].X;
                kamikaze.PlayerLocationY = MainShipList[0].Y;
            }
        }
Esempio n. 6
0
        private void SpawnEnemies()
        {
            EnemySpinner spinner1 = EnemySpinnerFactory.CreateNew();

            spinner1.EnemyState   = EnemySpinner.VariableState.DarkGrey;
            spinner1.TurningSpeed = 50;
            spinner1.Position     = new Microsoft.Xna.Framework.Vector3(-200, 200, 0);
            EnemySpinner spinner2 = EnemySpinnerFactory.CreateNew();

            spinner2.EnemyState   = EnemySpinner.VariableState.Metallic;
            spinner2.TurningSpeed = 70;
            spinner2.Position     = new Microsoft.Xna.Framework.Vector3(0, 200, 0);
            EnemySpinner spinner3 = EnemySpinnerFactory.CreateNew();

            spinner3.EnemyState   = EnemySpinner.VariableState.Purple;
            spinner3.TurningSpeed = 90;
            spinner3.Position     = new Microsoft.Xna.Framework.Vector3(200, 200, 0);
        }
Esempio n. 7
0
 private void BulletVsSpinnerCollisionActivity()
 {
     for (int i = BulletList.Count - 1; i > -1; i--)
     {
         for (int j = EnemySpinnerList.Count - 1; j > -1; j--)
         {
             Bullet       bullet  = BulletList[i];
             EnemySpinner spinner = EnemySpinnerList[j];
             if (bullet.Polygon.CollideAgainst(spinner.Polygon) &&
                 bullet.IsFromPlayer)
             {
                 spinner.HealthPoints -= bullet.Damage;
                 bullet.Destroy();
                 break;
             }
         }
     }
 }