Ejemplo n.º 1
0
 /// <summary>
 /// Allows the screen to create the hit bounds for a particular menu entry.
 /// </summary>
 protected virtual Rectangle GetMenuEntryHitBounds(MenuEntry entry)
 {
     // the hit bounds are the entire width of the screen, and the height of the entry
     // with some additional padding above and below.
     return new Rectangle(
         0,
         (int)entry.Position.Y - menuEntryPadding,
         ScreenManager.GraphicsDevice.Viewport.Width,
         entry.GetHeight(this) + (menuEntryPadding * 2));
 }
        //static bool frobnicate = true;
        //public int level = 0;

        #endregion

        #region Initialization


        /// <summary>
        /// Constructor.
        /// </summary>
        public LevelMenuScreen()
            : base("LevelSelect")
        {
            // Create our menu entries.
            Play = new MenuEntry(string.Empty);
            Level = new MenuEntry(string.Empty);
            //Difficulty = new MenuEntry(string.Empty);
            Shop = new MenuEntry(string.Empty);
            Instructions = new MenuEntry(string.Empty);

            // Hook up menu event handlers.
            Play.Selected += PlayMenuEntrySelected;
            Level.Selected += LevelMenuEntrySelected;
            //Difficulty.Selected += DifficultyMenuEntrySelected;
            Shop.Selected += UpgradeMenuEntrySelected;
            Instructions.Selected += InstructionsMenuEntrySelected;

            modes = new string[6];
            modes[0] = "Rampage";
            modes[1] = "Rampage - Timed";
            modes[2] = "Alter Ego";
            modes[3] = "Alter Ego - Timed";
            modes[4] = "Time Bandit";
            modes[5] = "Extermination";

            //if (GlobalSave.SaveDevice.FileExists(GlobalSave.containerName, GlobalSave.fileName_level))
            //{
            //    GlobalSave.SaveDevice.Load(
            //        GlobalSave.containerName,
            //        GlobalSave.fileName_level,
            //        stream =>
            //        {
            //            using (StreamReader reader = new StreamReader(stream))
            //            {
            //                level = int.Parse(reader.ReadLine());
            //            }
            //        });
            //}

            //Config.Level = (LevelSelect)level + 1;

            SetMenuEntryText();
            // Add entries to the menu.
            MenuEntries.Add(Play);
            MenuEntries.Add(Level);
            //MenuEntries.Add(Difficulty);
            MenuEntries.Add(Shop);
            menuEntries.Add(Instructions);

            Config.Level = (LevelSelect)Config.level + 1;
        }
Ejemplo n.º 3
0
        //InputAction menuCancel;

        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base("Astro Flare")
        {

            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry leaderboardMenuEntry = new MenuEntry("Online Leaderboards");
            MenuEntry creditsMenuEntry = new MenuEntry("Credits");

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            leaderboardMenuEntry.Selected += LeaderBoardMenuEntrySelected;
            creditsMenuEntry.Selected += CreditsMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(leaderboardMenuEntry);
            MenuEntries.Add(creditsMenuEntry);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            GameTitleEnabled = false;
            StartPosition = new Vector2(0f, 100f);
            // Create our menu entries.
            //ungulateMenuEntry = new MenuEntry(string.Empty);
            //languageMenuEntry = new MenuEntry(string.Empty);
            VibrateMenuEntry = new MenuEntry(string.Empty);
            MusicMenuEntry = new MenuEntry(string.Empty);
            SFXMenuEntry = new MenuEntry(string.Empty);
            ControlsEntry = new MenuEntry(string.Empty);
            ThumbsticksEntry = new MenuEntry(string.Empty);
            //elfMenuEntry = new MenuEntry(string.Empty);

            SetMenuEntryText();

            // Hook up menu event handlers.
            //ungulateMenuEntry.Selected += UngulateMenuEntrySelected;
            //languageMenuEntry.Selected += LanguageMenuEntrySelected;
            VibrateMenuEntry.Selected += VibrateMenuEntrySelected;
            MusicMenuEntry.Selected += MusicMenuEntrySelected;
            SFXMenuEntry.Selected += SFXMenuEntrySelected;
            ControlsEntry.Selected += ControlsEntrySelected;
            ThumbsticksEntry.Selected += ThumbsticksEntrySelected;
            //elfMenuEntry.Selected += ElfMenuEntrySelected;

            // Add entries to the menu.
            //MenuEntries.Add(ungulateMenuEntry);
            //MenuEntries.Add(languageMenuEntry);
            MenuEntries.Add(SFXMenuEntry);
            MenuEntries.Add(MusicMenuEntry);
            MenuEntries.Add(VibrateMenuEntry);
            MenuEntries.Add(ControlsEntry);
            MenuEntries.Add(ThumbsticksEntry);
            //MenuEntries.Add(elfMenuEntry);
        }