static public void Draw() { buffer.Graphics.Clear(Color.Black); buffer.Graphics.DrawImage(background, 0, 0, Width, Height); foreach (BaseObject obj in objs) { obj.Draw(); } foreach (Asteroids ast in asteroids) { if (ast != null) { ast.Draw(); } } foreach (AsteroidsBig astBig in asteroidsBig) { if (astBig != null) { astBig.Draw(); } } foreach (Nebula neb in nebula) { if (neb != null) { neb.Draw(); } } foreach (Bullet b in bullet) { if (b != null) { b.Draw(); } } foreach (Boss bss in boss) { if (bss != null) { bss.Draw(); } } ship.Draw(); medkit.Draw(); buffer.Graphics.DrawString("Health: " + ship.Health, SystemFonts.DefaultFont, Brushes.White, new Point(10, 10)); buffer.Graphics.DrawString("Score: " + score, SystemFonts.DefaultFont, Brushes.White, new Point(80, 10)); buffer.Graphics.DrawString("Wave: " + waveCount, SystemFonts.DefaultFont, Brushes.White, new Point(150, 10)); buffer.Render(); }
public static void Timer_Tick(object sender, EventArgs e) { Clear(); _medkit.Draw(); _ship.Draw(); Draw(_star); Draw(_bullets); Draw(_lasteroids); //Update(_lasteroids); Update(_star); Update(); s.Draw(); s.Update(); _medkit.Update(); if (_log != null) { _log("Статус"); _log -= Hit; _log -= ShipHit; } }