Esempio n. 1
0
        public override void Update(GameTime gameTime, bool OtherScreenHasFocus, bool CoveredByOtherScreen)
        {
            //Transition out
            if (Door.CurrentAnimation == 0)
            {
                Background.Update(gameTime);
                Player.Update(gameTime);
                Camera.Update(gameTime);
                Score.Update(gameTime);
                EnemyManager.Update(gameTime);
                Health.Update(gameTime);
                GFM.Update(gameTime);
                PickupManager.Update(gameTime);
            }
            else
            {
                if (Door.FinishedOnce)
                {
                    ScreenManager.AddScreen(new DeathScreen(ScreenManager, Score.Value));
                    ScreenManager.RemoveScreen(this);
                }
            }
            Door.Update(gameTime);

            base.Update(gameTime, OtherScreenHasFocus, CoveredByOtherScreen);
        }
Esempio n. 2
0
        public override void HandleInput(InputState Input, GameTime gameTime)
        {
            if (Input.IsNewKeyPress(Keys.F10))
            {
                Camera.ScreenShake(30, 0.009f);
            }
            if (Input.IsNewKeyStroke(Keys.F9))
            {
                Health.Value = 0;
            }
            if (Input.IsNewKeyStroke(Keys.F8))
            {
                GFM.SpawnExplosion(Player);
            }

            Player.HandleInput(Input, gameTime);
            base.HandleInput(Input, gameTime);
        }
Esempio n. 3
0
        public override void Draw(GameTime gameTime)
        {
            //Background
            spriteBatch.Begin((SpriteSortMode)0, null, SamplerState.PointClamp, null, null, null, Camera.Transform);
            Background.Draw(spriteBatch);
            EnemyManager.Draw(spriteBatch);
            PickupManager.Draw(spriteBatch);
            Player.Draw(spriteBatch);
            GFM.Draw(spriteBatch);
            spriteBatch.End();

            //Foreground
            spriteBatch.Begin((SpriteSortMode)0, null, SamplerState.PointClamp, null, null, null, Matrix.CreateScale(4f));
            Score.Draw(spriteBatch);
            Health.Draw(spriteBatch);
            Door.Draw(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }