/// <summary>
        /// Event handler for when the Play Game menu entry is selected.
        /// </summary>
        void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            BitSitsGames.ScoreData.Level = BitSitsGames.ScoreData.Score = 0;

            LoadingScreen.Load(ScreenManager, false, e.PlayerIndex,
                               new GameplayScreen(), new PauseMenuScreen());
        }
        /// <summary>
        /// Event handler for when the Play Game menu entry is selected.
        /// </summary>
        void NewGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            BitSitsGames.ScoreData.CurrentLevel = 0;
            BitSitsGames.ScoreData.PrevScore = 0;

            LoadingScreen.Load(ScreenManager, false, e.PlayerIndex,
                               new GameplayScreen());
        }
        /// <summary>
        /// Event handler for when the Resolution menu entry is selected.
        /// </summary>
        void SoundEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            BitSitsGames.Settings.SoundEnabled = !BitSitsGames.Settings.SoundEnabled;

            if (BitSitsGames.Settings.SoundEnabled) SoundEffect.MasterVolume = 1;
            else SoundEffect.MasterVolume = 0;

            SetMenuEntryText();
        }
        void MusicMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            BitSitsGames.Settings.MusicEnabled = !BitSitsGames.Settings.MusicEnabled;

            if (BitSitsGames.Settings.MusicEnabled) ScreenManager.GameContent.PlayMusic();
            else MediaPlayer.Pause();

            SetMenuEntryText();
        }
        /// <summary>
        /// Event handler for when the Quit Game menu entry is selected.
        /// </summary>
        void QuitMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            if (screen is GameplayScreen)
            LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen(),
                new LevelMenuScreen());

            if (screen is LabScreen)
                LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
        }
        /// <summary>
        /// Event handler for when the Frobnicate menu entry is selected.
        /// </summary>
        void IsFullScreenMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            BitSitsGames.Settings.IsFullScreen = !BitSitsGames.Settings.IsFullScreen;

            ScreenManager.GraphicsDeviceManager.IsFullScreen = BitSitsGames.Settings.IsFullScreen;
            ScreenManager.GraphicsDeviceManager.ApplyChanges();

            SetMenuEntryText();
        }
        void LoadLevelMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            int i = (int)((MenuEntry)sender).UserData;

            #if !DEBUG
            if (i > BitSitsGames.ScoreData.CurrentLevel) return;
            #endif

            ScreenManager.GameContent.levelIndex = i;
            LoadingScreen.Load(ScreenManager, false, e.PlayerIndex, new GameplayScreen());
        }
 void MessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     if (level.IsLevelUp)
     {
         prevScore += level.Score; score = prevScore;
         LoadNextLevel();
     }
     else if (level.ReloadLevel) ReloadCurrentLevel();
 }
예제 #9
0
 /// <summary>
 /// Event handler for when the Options menu entry is selected.
 /// </summary>
 void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new OptionsMenuScreen(), e.PlayerIndex);
 }
예제 #10
0
 /// <summary>
 /// Event handler for when the Options menu entry is selected.
 /// </summary>
 void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new OptionsMenuScreen(), e.PlayerIndex);
 }
예제 #11
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to exit" message box.
 /// </summary>
 void ConfirmExitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.Game.Exit();
 }
        void MessageBoxAccepted(object sender, PlayerIndexEventArgs e)
        {
            if (level.IsLevelUp)
                LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen(),
                    new LevelMenuScreen());

            else if (level.ReloadLevel) ReloadCurrentLevel();
        }
예제 #13
0
        /// <summary>
        /// Event handler for when the Elf menu entry is selected.
        /// </summary>
        void ElfMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            elf++;

            SetMenuEntryText();
        }
        /// <summary>
        /// Event handler for when the Language menu entry is selected.
        /// </summary>
        void LanguageMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentLanguage = (currentLanguage + 1) % languages.Length;

            SetMenuEntryText();
        }
 void LabSetupMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, e.PlayerIndex, new LabScreen());
 }
 public void ClampEquipment(object sender, PlayerIndexEventArgs e)
 {
     if (selectedEq != null)
     {
         selectedEq.isSelected = false;
         selectedEq.isClamped = true; selectedEq.SetMode(editMode, false);
         selectedEq = null;
     }
 }
        public void ClearLAB(object sender, PlayerIndexEventArgs e)
        {
            if (isLAB)
            {
                if (editMode)
                {
                    selectedEq = null;

                    for (int i = equipments.Count - 1; i >= 0; i--)
                    {
                        equipments[i].Remove(); equipments.Remove(equipments[i]);
                    }
                }
                else
                {
                    for (int i = atoms.Count - 1; i >= 0; i--)
                    {
                        atoms[i].Remove(); atoms.Remove(atoms[i]);
                    }
                }
            }
        }
        public void AddEqipment(object sender, PlayerIndexEventArgs ea)
        {
            EquipmentName en = EquipmentName.beaker;
            if (((MenuEntry)sender).UserData is EquipmentName)
                en = ((EquipmentName)((MenuEntry)sender).UserData);
            else return;

            Equipment e = new Equipment(en, gameContent, world);
            e.body.Position = camera.Position / gameContent.scale;

            if (selectedEq != null)
            {
                selectedEq.isSelected = false; selectedEq.SetMode(editMode, false); selectedEq = null;
            }
            selectedEq = e; selectedEq.isSelected = true; selectedEq.SetMode(editMode, false);
            equipmentAdded = true;

            if (equipments.Count == 0) equipments.Add(e);
            else
            {
                for (int i = 0; i < equipments.Count; i++)
                    if (e.equipName <= equipments[i].equipName)
                    {
                        equipments.Insert(i, e); return;
                    }

                equipments.Add(e);
            }
        }
        void MessageBoxAccepted(object sender, PlayerIndexEventArgs e)
        {
            if (level.IsLevelUp)
            {
                if (levelIndex == MaxLevelIndex)
                {
                    //LoadingScreen.Load(ScreenManager, false, null, new QuickMenuScreen());
                    //LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
                    LevelUpScreen l = new LevelUpScreen(true, false);
                    l.totalScore = Score;
                    l.totalStar = Stars;

                    l.Accepted += GameOverAccepted;
                    ScreenManager.AddScreen(l, null);
                    return;
                }

                //ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);

                LoadNextLevel();
            }
            else if (level.ReloadLevel) ReloadCurrentLevel();
        }
        void NewGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            BitSitsGames.ScoreData.LoadDefault(GameContent.MaxLevelIndex);

            PlayGameMenuEntrySelected(sender, e);
        }
        void MessageBoxAccepted(object sender, PlayerIndexEventArgs e)
        {
            if (level.IsLevelUp)
            {
                if (levelIndex == MaxLevelIndex)
                {
                    //LoadingScreen.Load(ScreenManager, false, null, new QuickMenuScreen());
                    LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
                    return;
                }

                LoadNextLevel();
                //ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
            }
            else
                if (level.ReloadLevel) ReloadCurrentLevel();
        }
예제 #22
0
        /// <summary>
        /// Event handler for when the Language menu entry is selected.
        /// </summary>
        void LanguageMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentLanguage = (currentLanguage + 1) % languages.Length;

            SetMenuEntryText();
        }
 void CreditsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new MessageBoxScreen(ScreenManager.GameContent.credits, false), e.PlayerIndex);
 }
예제 #24
0
 /// <summary>
 /// Event handler for when the Quit Game menu entry is selected.
 /// </summary>
 void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
 }
 /// <summary>
 /// Event handler for when the Play Game menu entry is selected.
 /// </summary>
 void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.AddScreen(new LevelMenuScreen(), e.PlayerIndex);
 }
예제 #26
0
 /// <summary>
 /// Event handler for when the user selects ok on the "are you sure
 /// you want to exit" message box.
 /// </summary>
 void ConfirmExitMessageBoxAccepted(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.Game.Exit();
 }
        /// <summary>
        /// Event handler for when the Ungulate menu entry is selected.
        /// </summary>
        void UngulateMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentUngulate++;

            if (currentUngulate > Ungulate.Llama)
                currentUngulate = 0;

            SetMenuEntryText();
        }
예제 #28
0
        /// <summary>
        /// Event handler for when the Frobnicate menu entry is selected.
        /// </summary>
        void FrobnicateMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            frobnicate = !frobnicate;

            SetMenuEntryText();
        }
        /// <summary>
        /// Event handler for when the Resolution menu entry is selected.
        /// </summary>
        void ResolutionMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            BitSitsGames.Settings.CurrentResolution = (BitSitsGames.Settings.CurrentResolution + 1)
                % Settings.Resolutions.Length;

            ScreenManager.GraphicsDeviceManager.PreferredBackBufferWidth =
                Settings.Resolutions[BitSitsGames.Settings.CurrentResolution].X;
            ScreenManager.GraphicsDeviceManager.PreferredBackBufferHeight =
                Settings.Resolutions[BitSitsGames.Settings.CurrentResolution].Y;
            ScreenManager.GraphicsDeviceManager.ApplyChanges();

            Camera2D.ResolutionScale = (float)Settings.Resolutions[BitSitsGames.Settings.CurrentResolution].X
                / Camera2D.BaseScreenSize.X;

            SetMenuEntryText();
        }
        /// <summary>
        /// Event handler for when the Elf menu entry is selected.
        /// </summary>
        void ElfMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            elf++;

            SetMenuEntryText();
        }
 /// <summary>
 /// Event handler for when the Quit Game menu entry is selected.
 /// </summary>
 void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new QuickMenuScreen());
 }
        /// <summary>
        /// Event handler for when the Frobnicate menu entry is selected.
        /// </summary>
        void FrobnicateMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            frobnicate = !frobnicate;

            SetMenuEntryText();
        }
예제 #33
0
 void ContGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, e.PlayerIndex,
                        new GameplayScreen());
 }
예제 #34
0
 /// <summary>
 /// Event handler for when the Play Game menu entry is selected.
 /// </summary>
 void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, e.PlayerIndex,
                        new GameplayScreen());
 }
예제 #35
0
 void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.Game.Exit();
 }
예제 #36
0
 void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     ScreenManager.Game.Exit();
 }
 /// <summary>
 /// Helper overload makes it easy to use OnCancel as a MenuEntry event handler.
 /// </summary>
 protected void OnCancel(object sender, PlayerIndexEventArgs e)
 {
     OnCancel(e.PlayerIndex);
 }
 void GameOverAccepted(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
 }