Ejemplo 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();

            // All the sprites
            BG.Draw(spriteBatch, this.Content);
            if (MyGameControl.GameState == GameControl.Gstate.Game)
            {
                CurrentRoom.DrawRoom(spriteBatch, this.Content);
                //Door.Draw(spriteBatch, this.Content);
                MyGameControl.Draw(spriteBatch, this.Content);
                HUD1.DrawHUD(spriteBatch, this.Content);
                SettingsButton.Draw(spriteBatch, this.Content);

                if (CurrentRoom.getIntegerForm() == MyGameControl.MyMap.getWumpusRoom())
                {
                    MyGameControl.MyWumpus.Draw(spriteBatch, this.Content);
                }
            }
            else if (MyGameControl.GameState == GameControl.Gstate.Menu)
            {
                MyMenu.Draw(spriteBatch, this.Content);
            }

            // Debugging purposes: Text drawing
            DrawText();

            // And, of course, the cursor
            if (KBState.IsKeyDown(Keys.A))
            {
                CursorRight.AssetName = "ScreenPointers\\AnimatedCursor16";
                CursorRight.DrawAnimated(spriteBatch, this.Content);
            }
            else
            {
                CursorRight.AssetName = "ScreenPointers\\cursor2";
                CursorRight.Draw(spriteBatch, this.Content);
            }

            spriteBatch.End();
            base.Draw(gameTime);
        }