public static void Draw() { if (__Ship.Energy <= 0) { return; } var g = __Buffer.Graphics; g.Clear(Color.Black); //g.DrawRectangle(Pens.White, new Rectangle(50,50,200,200)); //g.FillEllipse(Brushes.Red, new Rectangle(100,50,70, 120)); foreach (var visual_object in __GameObjects) { visual_object?.Draw(g); } foreach (var visual_object in __StarObjects) { visual_object?.Draw(g); } __Bullet?.Draw(g); __Ship.Draw(g); g.DrawString($"Energy: { __Ship.Energy}", new Font(FontFamily.GenericSansSerif, 14, FontStyle.Italic), Brushes.White, 10, 10); g.DrawString($"Уничтожено объектов: { count_Stars}", new Font(FontFamily.GenericSansSerif, 14, FontStyle.Italic), Brushes.White, 10, 35); __Buffer.Render(); }
/// <summary>Метод визуализации сцены</summary> public static void Draw() { var g = __Buffer.Graphics; g.Clear(Color.Black); //g.DrawRectangle(Pens.White, new Rectangle(50, 50, 200, 200)); //g.FillEllipse(Brushes.Red, new Rectangle(100, 50, 70, 120)); foreach (var visual_object in __GameObjects) { visual_object?.Draw(g); } __Bullet.Draw(g); __Buffer.Render(); }
/// <summary>Метод визуализации сцены</summary> public static void Draw() { if (__Ship.Energy <= 0) { return; } var g = __Buffer.Graphics; g.Clear(Color.Black); foreach (var visual_object in __GameObjects) { visual_object?.Draw(g); } __Bullet?.Draw(g); __Ship.Draw(g); g.DrawString($"Energy: {__Ship.Energy}", new Font(FontFamily.GenericSansSerif, 14, FontStyle.Italic), Brushes.White, 10, 10); __Buffer.Render(); }