Esempio n. 1
0
 public override void Draw(Renderer renderer)
 {
     base.Draw(renderer);
     DrawWarning(renderer);
     pManager.Draw();
 }
Esempio n. 2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            if (state == GameState.None)
            {
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null);
                spriteBatch.Draw(background, new Rectangle(0, 0, width, height), Color.White);
                spriteBatch.End();

                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null, cam.Matrix);
                level.Draw(spriteBatch, character, pixel);
                character.Draw(spriteBatch, pixel);
                spriteBatch.End();

                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null, cam.Matrix);
                pMan.Draw(spriteBatch);
                spriteBatch.End();

                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, null, null, null);
                spriteBatch.Draw(bgBlurred, new Rectangle(0, 0, width, height), Color.White * bgFlicker);
                spriteBatch.End();

                spriteBatch.Begin();
                spriteBatch.Draw(overlay, new Rectangle(0, 0, width, height), Color.Black);
                spriteBatch.End();

                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null, cam.Matrix);
                hud.DrawCamRelated(spriteBatch, character, level);
                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null);
                hud.Draw(spriteBatch, character, level);
                hud.DrawSignMessages(spriteBatch, character, level);
                spriteBatch.End();

                if (paused)
                {
                    spriteBatch.Begin();
                    spriteBatch.Draw(pixel, new Rectangle(0, 0, width, height), Color.Black * 0.8f);
                    spriteBatch.DrawString(font, "PAUSED", new Vector2(width, height) / 2f, Color.White, 0f, font.MeasureString("PAUSED") / 2f, 1f, SpriteEffects.None, 1f);
                    const string psMessage = "ENTER = RESUME";
                    spriteBatch.DrawString(font, psMessage, new Vector2(width / 2f, height / 2f + 60), Color.Green, 0f, font.MeasureString(psMessage) / 2f, 1f, SpriteEffects.None, 1f);
                    const string escMessage = "ESC = EXIT GAME";
                    spriteBatch.DrawString(font, escMessage, new Vector2(width / 2f, height / 2f + 90), Color.Red, 0f, font.MeasureString(escMessage) / 2f, 1f, SpriteEffects.None, 1f);
                    spriteBatch.End();
                }

                //Fade in
                spriteBatch.Begin();
                spriteBatch.Draw(pixel, new Rectangle(0, 0, width, height), Color.Black * (1f - fadeIn.Progress));
                spriteBatch.End();
            }
            if (state == GameState.GameOver)
            {
                GraphicsDevice.Clear(Color.White);
                spriteBatch.Begin();
                spriteBatch.Draw(gameOverTex, new Vector2(width / 2f, height / 2f), null, Color.Lerp(splashColor, nextSplashColor, splashCurrent / splashColorInterval), 0f, new Vector2(gameOverTex.Width, gameOverTex.Height) / 2f, 1f, SpriteEffects.None, 1f);
                spriteBatch.End();
            }


            //Fade logo
            if (state == GameState.Splash)
            {
                GraphicsDevice.Clear(Color.White);
                spriteBatch.Begin();
                spriteBatch.Draw(logoTex, new Vector2(width / 2f, height / 2f), null, Color.Lerp(splashColor, nextSplashColor, splashCurrent / splashColorInterval), 0f, new Vector2(logoTex.Width, logoTex.Height) / 2f, 1f, SpriteEffects.None, 1f);
                spriteBatch.End();
            }

            base.Draw(gameTime);
        }
Esempio n. 3
0
 public override void Draw(Renderer renderer)
 {
     particleManager.Draw(renderer);
     renderer.DrawTexture(name, position, motion.DrawingRange(), Color.White);
 }