Exemple #1
0
 public static void Draw()
 {
     Buffer.Graphics.Clear(Color.Black);
     foreach (BaseObject baseObject in baseObjects)
     {
         baseObject.Draw();
     }
     foreach (Asteroid asteroid in asteroids)
     {
         asteroid?.Draw();
     }
     foreach (Bullet bullet in _bullets)
     {
         bullet.Draw();
     }
     firstAidKit?.Draw();
     //bullet?.Draw();
     ship?.Draw();
     if (ship != null)
     {
         Buffer.Graphics.DrawString("Energy: " + ship.Energy, SystemFonts.DefaultFont, Brushes.White, 0, 0);
     }
     if (asteroids != null)
     {
         Buffer.Graphics.DrawString("Asteroids: " + count, SystemFonts.DefaultFont, Brushes.White, 0, 15);
     }
     Buffer.Render();
 }
Exemple #2
0
 /// <summary>
 /// Метод отрисовывает изображение в окне
 /// </summary>
 public static void Draw()
 {
     Buffer.Graphics.DrawImage(_images[0], 0, 0, Width, Height);
     foreach (BaseObject obj in _objs)
     {
         obj?.Draw();
     }
     foreach (Asteroid obj in asteroidsArr)
     {
         obj?.Draw();
     }
     foreach (Bullet b in _bullets)
     {
         b.Draw();
     }
     _ship?.Draw();
     _fak?.Draw();
     if (_ship != null)
     {
         Buffer.Graphics.DrawString("Energy:" + _ship.Energy, SystemFonts.DefaultFont, Brushes.White, 10, 10);
         Buffer.Graphics.DrawString("Score:" + _ship.Score, SystemFonts.DefaultFont, Brushes.White, 100, 10);
     }
     Buffer.Render();
 }