public override void OnDraw(float elapsedTime) { _gameBackground.Draw(); _weather.Draw(elapsedTime); Game.DepthRenderer.Draw(Game.SpriteBatch); _explosionManager.Draw(); Game.ShapeRenderer.DrawFilledRectangle(0, 0, 800, 600, Color.White * _weather._sun._blendVal); _weather._cloud.RenderRainOnTop(elapsedTime); //Game.ShapeRenderer.DrawFilledRectangle(0, 0, 800, 600, Color.Gray * 0.5f); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(); if (gameState == GameStates.TitleScreen) { spriteBatch.Draw(titleScreen, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), Color.White); } if ((gameState == GameStates.Playing) || (gameState == GameStates.PlayerDead) || (gameState == GameStates.GameOver)) { starField.Draw(spriteBatch); asteroidManager.Draw(spriteBatch); playerManager.Draw(spriteBatch); enemyManager.Draw(spriteBatch); explosionManager.Draw(spriteBatch); spriteBatch.DrawString(pericles14, "Score: " + playerManager.PlayerScore.ToString(), scoreLocation, Color.Yellow); if (playerManager.LivesRemaining >= 0) { spriteBatch.DrawString(pericles14, "Lives: " + playerManager.LivesRemaining.ToString(), livesLocation, Color.Yellow); } } if (gameState == GameStates.GameOver) { spriteBatch.DrawString(pericles14, "G A M E O V E R", new Vector2(Window.ClientBounds.Width / 2 - pericles14.MeasureString("G A M E O V E R").X / 2, 50), Color.Red); } spriteBatch.End(); base.Draw(gameTime); }