Time for action – drawing the game structure
In the
Game1.cs
file, replace the currentDraw
method with the following:protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(); if (gameState == GameStates.TitleScreen) { spriteBatch.Draw(titleScreen, new Rectangle(0, 0, this.Window.ClientBounds.Width, this.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.White); ...