private void RemoveAsterice() { for (int i = AstericeList.Count - 1; i > -1; i--) { Asterice asterice = AstericeList[i]; //Remove asterice when outside screen + then some if (Math.Abs(asterice.X) > 800 + 30 || Math.Abs(asterice.Y) > 450 + 30) { asterice.Destroy(); } } }
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; }
private void AstericeVsMainShipCollisionActivity() { for (int i = MainShipList.Count - 1; i > -1; i--) { for (int j = AstericeList.Count - 1; j > -1; j--) { MainShip mainShip = MainShipList[i]; Asterice asterice = AstericeList[j]; if (mainShip.Polygon.CollideAgainst(asterice.Polygon)) { this.save.Data.astericeNumber += asterice.Value; asterice.Destroy(); break; } } } }