public static void Update() { foreach (BaseObject obj in _objs) { obj.Update(); } foreach (Bullet b in _bullets) { b.Update(); } for (var i = 0; i < _asteroids.Count; i++) { if (_asteroids[i] == null) { continue; } _asteroids[i].Update(); for (int j = 0; j < _bullets.Count; j++) { if (_asteroids[i] != null && _bullets[j].Collision(_asteroids[i])) { System.Media.SystemSounds.Hand.Play(); _asteroids[i] = null; _bullets.RemoveAt(j); j--; } } if (_asteroids[i] == null || !_ship.Collision(_asteroids[i])) { continue; } _ship.HPLow(Rnd.Next(1, 10)); System.Media.SystemSounds.Asterisk.Play(); if (_ship.HP <= 0) { _ship.Die(); } } foreach (MedicalKit a in medkit) { a.Update(); } /*for (var i = 0; i < medkit.Count; i++) * { * medkit[i].Update(); * if (medkit[i] == null) continue; * medkit[i].Update(); * for (int j = 0; j < medkit.Count; j++) * if (medkit[i] != null && _ship.Collision(medkit[i])) * { * System.Media.SystemSounds.Question.Play(); * medkit[i] = null; * } * if (medkit[i] == null || !_ship.Collision(medkit[i])) continue; * _ship.HPRise(Rnd.Next(1, 20)); * System.Media.SystemSounds.Asterisk.Play(); * }*/ }