Example #1
0
 private void QuitButton_Click(object sender, EventArgs e)
 {
     if (_level != null)
     {
         _level._waterStart.Stop();
         _level._waterLoop.Stop();
     }
     _game.ChangeState(new MenuState(_game, _graphicsDevice, _content));
 }
Example #2
0
        public MainMenu(Game1 game) : base(game)
        {
            var navigation = new VerticalNavigationMenu(game.inputManager, new List <IButton>()
            {
                new TextButton(inputManager, font, "PLAY")
                {
                    OnClick = (o, e) => game.ChangeState(new FirstLevel(game))
                },
                new TextButton(inputManager, font, "HOW TO PLAY")
                {
                    OnClick = (o, e) => game.ChangeState(new HowToPlay(game))
                },
                new TextButton(inputManager, font, "EXIT")
                {
                    OnClick = (o, e) => game.Exit()
                }
            });

            navigation.Position = new Vector2(game.LogicalSize.X / 2 - navigation.Size.X / 2, game.LogicalSize.Y / 2 - navigation.Size.Y / 2);
            AddUiComponent(navigation);
        }
Example #3
0
 public static void Load()
 {
     Read();
     Game1.ChangeState((int)State.MENU);
 }
Example #4
0
 /// <summary>
 /// Starts the game in survival mode, which is represented has "level 0"
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PlayGameButton_Click(object sender, EventArgs e)
 {
     _game.ChangeState(new MonoKong(_game, _graphicsDevice, _content));
 }
Example #5
0
 public Reset()
 {
     myMapManager = new MapManager();
     Game1.ChangeState((int)State.PLAY);
 }
Example #6
0
 private void StartGame()
 {
     Game1.ChangeState((int)State.PREPARE); //Changes the current state to PREPARE.
 }
Example #7
0
 private void Upgrade()
 {
     Game1.ChangeState((int)State.UPGRADE);
 }
Example #8
0
 private void NewGame()
 {
     Other.File.NewGame();
     Game1.ChangeState((int)State.MENU);
 }
Example #9
0
 private void Menu()
 {
     Game1.ChangeState((int)State.MENU);
 }
 public static void Init(Game1 game, ContentManager content)
 {
     LevelInfo = new LevelInfo[]
     {
         new LevelInfo(0, "CLUB NEON", content.Load <Texture2D>("Textures/LevelSelect/ClubNeon"), () => game.ChangeState(new ClubNeon(game, 0, true))),
         new LevelInfo(1, "PRISON", content.Load <Texture2D>("Textures/LevelSelect/Prison"), () => game.ChangeState(new PrisonPart1(game, 1, true))),
         new LevelInfo(2, "SOON?", content.Load <Texture2D>("Textures/LevelSelect/Escape"), () => game.ChangeState(new LevelSelect(game))),
     };
 }
Example #11
0
 private void Back()
 {
     Game1.ChangeState((int)State.MENU);
 }
Example #12
0
 // show the game
 public static void showGame()
 {
     StateManager.gameS = new GameState(game, graphicsDevice, content);
     game.ChangeState(gameS);
     updateLastCurrent(gameS);
 }
Example #13
0
 private void Start()
 {
     MapManager.Pause.ResetPause();
     Game1.ChangeState((int)State.RESET);
 }
Example #14
0
 private void Back()
 {
     Game1.ChangeState((int)State.MENU); //Changes the current state to MENU.
 }