//################################# // Draw //################################# public override void Draw(GameTime gameTime) { Global.GraphicsManager.GraphicsDevice.Clear(ClearOptions.Target, Color.Black, 0, 0); // calling draw of objects where necessary _back.Draw(90, new Vector3(-15000, -2000, -15000)); _station.Draw(Global.StationColor); _planet.Draw(Global.PlanetColor); _droneFleet.Draw(); _asteroidField.Draw(); _waveBuilder.Draw(gameTime); // Particle dustParticles.Draw(); borderParticles.Draw(); hitmarkerParticles.Draw(); foreach (ExplosionSystem explosion in explosionList) { explosion.Draw(); } //if drone is dead fade to black if (_deadDroneAlpha > 0) { _actualDeadDroneAlpha = MathHelper.Lerp(0f, 2f, _deadDroneAlpha / 2); ScreenManager.FadeBackBufferToBlack(_actualDeadDroneAlpha); } // If the game is transitioning on or off, fade it out to black. if (TransitionPosition > 0 || _pauseAlpha > 0) { float alpha = MathHelper.Lerp(1f - TransitionAlpha, 1f, _pauseAlpha / 2); ScreenManager.FadeBackBufferToBlack(alpha); } DrawStationDirectionArrow(); DrawShipDirectionArrow(); if (_waveBuilder.HasEnded && !_station.IsDead) { DrawCaptainDialog(new Point(Global.GraphicsManager.GraphicsDevice.Viewport.Width / 2 - 200, Global.GraphicsManager.GraphicsDevice.Viewport.Height / 2 - 100), " You Succeded!\n\n General Stargaz\n\nI am proud of you Pilot, you did your\njob very well. I couldn't have done\nit better myself.\nHere, take that medal and some\nvacation on this Spa Station not\nfar from your home Planet.\nThank you for your service, Pilot!\nDismissed!"); deadTime -= gameTime.ElapsedGameTime.Milliseconds; } else if (_station.IsDead) { DrawCaptainDialog(new Point(Global.GraphicsManager.GraphicsDevice.Viewport.Width / 2 - 200, Global.GraphicsManager.GraphicsDevice.Viewport.Height / 2 - 100), " You Died!\n\n General Stargaz\n\nThis Pilot did his duty in combat with\ngreat courage and steadfast dedication\neven after he was outnumbered by\nthe hundreds.\nHe sacrificed his life to defend the\nones who couldn't themselves. "); deadTime -= gameTime.ElapsedGameTime.Milliseconds; } if (_station._shield > 0) { _sphere.Draw(new Color(255, 255, 255), _sphereAlpha); } //FRAME & UI ALWAYS LAST _ui.Draw(_droneFleet); _frame.Draw(); }
//################################# // Draw //################################# public override void Draw(GameTime gameTime) { Global.GraphicsManager.GraphicsDevice.Clear(ClearOptions.Target, Color.Black, 0, 0); // calling draw of objects where necessary _back.Draw(90, new Vector3(-5000, -2500, -5000)); _station.Draw(Global.StationColor); _planet.Draw(Global.PlanetColor); _droneFleet.Draw(); foreach (ExplosionSystem explosion in explosionList) { explosion.Draw(); } // If the game is transitioning on or off, fade it out to black. if (TransitionPosition > 0 || _pauseAlpha > 0) { float alpha = MathHelper.Lerp(1f - TransitionAlpha, 1f, _pauseAlpha / 2); ScreenManager.FadeBackBufferToBlack(alpha); } if (movementAllowed) { _asteroidField.Draw(); } borderParticles.Draw(); dustParticles.Draw(); DrawDirectionArrow(); DrawDialog(); explosionParticles.Draw(); if (_station._shield > 0) { _sphere.Draw(new Color(255, 255, 255), _sphereAlpha); } //FRAME & UI ALWAYS LAST _ui.Draw(_droneFleet); _frame.Draw(); }