Пример #1
0
        public static void FullClear()
        {
            for(int i = 0; i < controllers.Count; i++)
            {
                controllers[i].FullClear();
            }

            sound = SoundFactory.Instance.FirstLevel();
            //create mario/player
            //mario.RaiseCollisionEvent += player.HandleMarioCollision;
               // mario.RaiseInstantDeathEvent += player.HandleInstantDeathEvent;
            KeyboardController keyboard = new KeyboardController();
            GamepadController gamepad = new GamepadController();
            Loader.LoadLevel(camera, "LevelLoader/World1-2.txt");
            level.SetUpLevel();
            level.RaiseLevelEvent += mario.HandleLevelEvent;
            level.State = new Playing(level);
            level.State.Enter();
        }
Пример #2
0
 /// <summary>
 /// this resets the game completely, like quiting the processes and restarting it.
 /// </summary>
 public static void FullReset()
 {
     currentLevel = 1;
     sound = SoundFactory.Instance.FirstLevel();
     //create mario/player
     player = new Player
     {
         PlayerMario = new Mario(theGame.Content.Load<Texture2D>("mario/mario_sprites"))
     };
     mario = player.PlayerMario;
     //mario.RaiseCollisionEvent += player.HandleMarioCollision;
     //mario.RaiseInstantDeathEvent += player.HandleInstantDeathEvent;
     KeyboardController keyboard = new KeyboardController();
     GamepadController gamepad = new GamepadController();
     Loader.LoadLevel(camera, "LevelLoader/World1-1.txt");
     level.SetUpLevel();
     level.RaiseLevelEvent += mario.HandleLevelEvent;
     level.State = new Playing(level);
     level.State.Enter();
     Rectangle limits = level.GetTree().Bounds;
     limits.Height -= 16;
     camera.Limits = limits;
 }