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.Black);// new Color(172.0f/255.0f, 134.0f / 255.0f, 85.0f / 255.0f));

            // TODO: Add your drawing code here
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp);

            if (_sceneCurrent != null)
            {
                _sceneCurrent.Draw(spriteBatch);
            }
            MouseManager.Draw(spriteBatch);

            spriteBatch.End();

            base.Draw(gameTime);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            MouseInput.Update();
            KeyboardInput.Update();
            // TODO: Add your update logic here
            MouseManager.Update(gameTime);
            if (_sceneCurrent == null)
            {
                switch (_state)
                {
                case State.QUIT:
                    Exit();
                    break;

                case State.MAIN_MENU:
                    _sceneCurrent = new SceneMainMenu();
                    break;

                case State.PLAY:
                    _sceneCurrent = new ScenePlay();
                    break;

                case State.TEST_MAP:
                    _sceneCurrent = new SceneTestMap();
                    break;
                }
                _sceneCurrent.LoadContent(Content);
            }
            else
            {
                _sceneCurrent.Update(gameTime);
            }


            base.Update(gameTime);
        }