/// <summary> /// Метод рисования элементов /// </summary> public static void Draw() { Buffer.Graphics.Clear(Color.Black); galaxy?.GalaxyShow(); _ship?.Draw(); sputnic?.Draw(); aidKit?.Draw(); foreach (Asteroid a in asteroids) { a.Draw(); } foreach (Bullet b in bullets) { b.Draw(); } foreach (KeyValuePair <Bullet, Direction> keyValue in bulletDirections) { keyValue.Key.Draw(); } //Вывод на экран информации о энергии корабля и количестве сбитых астероидов if (_ship != null) { Buffer.Graphics.DrawString("Energy:" + _ship.Energy, SystemFonts.DefaultFont, Brushes.White, 0, 0); Buffer.Graphics.DrawString("Points for asteroids:" + countAsteroids, SystemFonts.DefaultFont, Brushes.White, 100, 0); } Buffer.Render(); }
/// <summary> /// Отрисовка всех объектов /// </summary> public static void Draw() { Buffer.Graphics.Clear(Color.Black); Buffer.Graphics.DrawString("Health:" + _ship.Heath, SystemFonts.DefaultFont, Brushes.White, 0, 0); Buffer.Graphics.DrawString("Score:" + _ship.Score, SystemFonts.DefaultFont, Brushes.White, Width / 2, 0); foreach (Star star in _stars) { star.Draw(); } foreach (Asteroid asteroid in _asteroids) { asteroid.Draw(); } foreach (Bullet bullet in Bullets) { bullet.Draw(); } _aidKit?.Draw(); _ship.Draw(); Buffer.Render(); }