Beispiel #1
0
 private void PlayerLocationActivity()
 {
     for (int i = 0; i < EnemyKamikazeList.Count; i++)
     //for (int i = EnemyKamikazeList.Count - 1; i > -1; i--)
     {
         EnemyKamikaze kamikaze = EnemyKamikazeList[i];
         kamikaze.PlayerLocationX = MainShipInstance.X;
         kamikaze.PlayerLocationY = MainShipInstance.Y;
     }
 }
        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;
        }
 private void KamikazeVsMainShipCollisionActivity()
 {
     for (int i = EnemyKamikazeList.Count - 1; i > -1; i--)
     {
         EnemyKamikaze kamikaze = EnemyKamikazeList[i];
         if (kamikaze.Polygon.CollideAgainst(MainShipList[0].Polygon))
         {
             //Change this to PlayerShip.TakeDamage() later?
             MainShipList[0].HealthPoints -= kamikaze.Damage;
             kamikaze.Explode();
         }
     }
 }
        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;
        }
Beispiel #5
0
        private void SpawnEnemies()
        {
            EnemyKamikaze kamikaze1 = EnemyKamikazeFactory.CreateNew();

            kamikaze1.EnemyState = EnemyKamikaze.VariableState.DarkGrey;
            kamikaze1.Position   = new Microsoft.Xna.Framework.Vector3(-200, 200, 0);
            EnemyKamikaze kamikaze2 = EnemyKamikazeFactory.CreateNew();

            kamikaze2.Position   = new Microsoft.Xna.Framework.Vector3(0, 200, 0);
            kamikaze2.EnemyState = EnemyKamikaze.VariableState.Metallic;
            EnemyKamikaze kamikaze3 = EnemyKamikazeFactory.CreateNew();

            kamikaze3.Position   = new Microsoft.Xna.Framework.Vector3(200, 200, 0);
            kamikaze3.EnemyState = EnemyKamikaze.VariableState.Purple;
        }
        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;
            }
        }
Beispiel #7
0
 private void BulletVsKamikazeCollisionActivity()
 {
     for (int i = BulletList.Count - 1; i > -1; i--)
     {
         for (int j = EnemyKamikazeList.Count - 1; j > -1; j--)
         {
             Bullet        bullet   = BulletList[i];
             EnemyKamikaze kamikaze = EnemyKamikazeList[j];
             if (bullet.Polygon.CollideAgainst(kamikaze.Polygon))
             {
                 //Change this to PlayerShip.TakeDamage() later as well..
                 kamikaze.HealthPoints -= bullet.Damage;
                 bullet.Destroy();
                 break;
             }
         }
     }
 }