Exemple #1
0
 public void Execute()
 {
     if (receiver.PowerState is SmallState)
     {
         //receiver.DeadMario();
         receiver.Die();
     }
     else if (receiver.PowerState is SuperState)
     {
         receiver.SmallMario();
     }
     else if (receiver.PowerState is FireState)
     {
         receiver.SmallMario();
     }
 }
Exemple #2
0
        public void Update(GameTime gameTime)
        {
            TextPos = new Vector2(game.GraphicsDevice.Viewport.Width / 2, game.GraphicsDevice.Viewport.Height / 2);

            if (game.Paused == false)
            {
                currentTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
                if (currentTime >= countDuration)
                {
                    if (avatar.Toxicity >= 0 && !avatar.Sprite.IsMasked)
                    {
                        avatar.Toxicity++;
                        currentTime -= countDuration;
                    }
                }
            }

            if (timeBoo)
            {
                if (Game1.HUDMap["Time"] == 0)
                {
                    avatar.Die();
                    timeBoo = false;
                }
            }
            if (resetBoo)
            {
                //if (avatar.Position.Y >= 209) {
                //    if (Game1.HUDMap["Lives"] > 1) {
                //        avatar.Die();
                //        resetBoo = false;
                //   } else {
                //       avatar.Die();
                //        game.GameOver();
                //     }
                //}
            }

            if (Game1.HUDMap["Time"] <= 3 && warning == false)
            {
                MediaPlayer.Stop();
                Game1.SoundMap["TimeWarning"].Play();

                warning = true;
            }
        }