Exemplo n.º 1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            //GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();
            spriteBatch.Draw(background, Vector2.Zero, Color.White);
            bgScroll.Draw(spriteBatch);

            if (gameState == GameState.Menu)
            {
                spriteBatch.Draw(logo, new Vector2((Width - logo.Width) / 2, 100), Color.White);
                if (textEnable)
                {
                    spriteBatch.DrawString(pericles14, "Press Space to continue", new Vector2(280, 300), Color.White);
                }
            }
            bgScroll2.Draw(spriteBatch);
            if (gameState == GameState.Play)
            {
                ship.Draw(spriteBatch);
                ShotManager.Draw(spriteBatch);
                AsteroidsManager.Draw(spriteBatch);
                ExplosionsManager.Draw(spriteBatch);
                spriteBatch.DrawString(pericles14, $"Score: {score}", new Vector2(10, 10), Color.White);
            }
            spriteBatch.End();

            base.Draw(gameTime);
        }
Exemplo n.º 2
0
 public static void Draw(SpriteBatch spriteBatch)
 {
     shotManager.Draw(spriteBatch);
     shipSprite.Draw(spriteBatch);
 }