Example #1
0
        /// <summary>
        ///     Se llama cada vez que hay que refrescar la pantalla.
        ///     Escribir aquí todo el código referido al renderizado.
        /// </summary>
        protected override void Draw(GameTime gameTime)
        {
            // Aca deberiaos poner toda la logia de renderizado del juego.
            //GraphicsDevice.Clear(Color.Black);

            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.BlendState        = BlendState.Opaque;

            GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.Black, 1f, 0);

            // Set the main render target, here we'll draw the base scene
            //GraphicsDevice.SetRenderTarget(MainSceneRenderTarget);

            switch (status)
            {
            case ST_MENU:
                MenuUI.Draw(gameTime);
                break;

            case ST_LEVEL_1:
                //Lamp.Draw(gameTime);
                Map.Draw(gameTime);
                break;

            case ST_DEFEAT:
                DefeatUI.Draw(gameTime);
                break;

            case ST_WIN:
                WinUI.Draw(gameTime);
                break;
            }

            //Weapon.Draw(gameTime);

            // Set the render target as null, we are drawing into the screen now!
            //GraphicsDevice.SetRenderTarget(null);
            //GraphicsDevice.Clear(Color.Black);

            base.Draw(gameTime);
        }