Exemplo n.º 1
0
        public void Button_OnClick(UIButton source)
        {
            if (currElement == null)
                return;

            switch (source.ButtonType)
            {
                case UIButton.Button.clearButton:
                    m_Level.AddSFX(Level.SFXNames.resetElement);
                    currElement.Destroy();
                    break;
                default:
                    return;
            }
            currElement = null;
        }
Exemplo n.º 2
0
        public void LoadContent(Level a_Level, int slot)
        {
            if (m_tBackground == null)
            {
                m_tBackground = a_Level.Content.Load<Texture2D>("UI/SaveSlot");
            }

            m_btnClear = new UIButton(m_Position + new Vector2(70, -5), m_Level.Content, UIButton.Button.clearButton, true, slot);
        }
Exemplo n.º 3
0
 public void Dispose()
 {
     Element.ElementBuilder.OnBuild -= ElementBuilt;
     m_btnCast.OnClick -= Button_OnClick;
     m_btnClear.OnClick -= Button_OnClick;
     Element.OnSpamDrop -= Element_OnSpamDrop;
     m_btnCastAll.OnClick -= Button_OnClick;
     m_btnClearAll.OnClick -= Button_OnClick;
     //if nobody else is connected, clean them up
     if (m_btnClearAll.OnClick == null)
     {
         m_btnClearAll = null;
         m_btnCastAll = null;
     }
     m_btnClear.Dispose();
     m_btnCast.Dispose();
     currElement = null;
     m_Level = null;
 }
Exemplo n.º 4
0
 public void LoadContent(Level a_Level, int slot)
 {
     if (m_tBackground == null)
     {
         m_tBackground = a_Level.Content.Load<Texture2D>("UI/mat");
     }
     m_btnCast = new UIButton(m_Position + new Vector2(220, 24), m_Level.Content, UIButton.Button.castButton, true, slot);
     m_btnCast.OnClick += Button_OnClick;
     m_btnClear = new UIButton(m_Position + new Vector2(220, 72), m_Level.Content, UIButton.Button.clearButton, true, slot);
     m_btnClear.OnClick += Button_OnClick;
     a_Level.Add(m_btnCast);
     a_Level.Add(m_btnClear);
     if (m_btnCastAll == null)
     {
         m_btnCastAll = new UIButton(new Vector2(516, 695), m_Level.Content, UIButton.Button.castallButton, true, -1);
         m_btnClearAll = new UIButton(new Vector2(280, 695), m_Level.Content, UIButton.Button.clearallButton, true, -1);
         a_Level.Add(m_btnCastAll);
         a_Level.Add(m_btnClearAll);
     }
     m_btnCastAll.OnClick += Button_OnClick;
     m_btnClearAll.OnClick += Button_OnClick;
 }
Exemplo n.º 5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            //Songs
            mainMenuSong = Content.Load<Song>("Sound/Know Thyself");
            gameSong = Content.Load<Song>("Sound/MainGameMusic");
            creditsSong = Content.Load<Song>("Sound/Credits");
            MediaPlayer.IsRepeating = true;

            audioEngine = new AudioEngine("Content/Sound/GameAudio.xgs");
            waveBank = new WaveBank(audioEngine, "Content/Sound/Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, "Content/Sound/Sound Bank.xsb");
            mainMenuCue = soundBank.GetCue("KnowThyself");
            inGameCue = soundBank.GetCue("InGameMusic");
            creditsCue = soundBank.GetCue("Credits");

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Fonts
            lithosProBlack = Content.Load<SpriteFont>("UI/Lithos Pro Regular");
            lithosProMenu = Content.Load<SpriteFont>("UI/Lithos Pro Regular Menu");
            bradleyHand = Content.Load<SpriteFont>("UI/Bradley Hand ITC TT");

            // Load Menu information.
            pauseOverlay = Content.Load<Texture2D>("Menus/pauseMenuOverlay");
            pauseBanner = Content.Load<Texture2D>("UI/paused-banner");
            mainMenuBackground = Content.Load<Texture2D>("Menus/backdrop-no-animation");
            instructionsScreen = new TextScroll(Content, input, "UI/dialog-instructions");
            creditsScreen = new TextScroll(Content, input, "UI/dialog-credits");
            gameOverScreen = new NotificationScroll(Content, input, "UI/dialog-backdrop", "Game Over");
            gameCompleteScreen = new NotificationScroll(Content, input, "UI/dialog-backdrop", "You Have Won!");

            mainMenuIconDimL = Content.Load<Texture2D>("UI/button-dim-left");
            mainMenuIconDimR = Content.Load<Texture2D>("UI/button-dim-right");
            mainMenuIconDimC = Content.Load<Texture2D>("UI/button-dim-middle");
            mainMenuIconLitL = Content.Load<Texture2D>("UI/button-lit-left");
            mainMenuIconLitR = Content.Load<Texture2D>("UI/button-lit-right");
            mainMenuIconLitC = Content.Load<Texture2D>("UI/button-lit-middle");

            pauseMenuIconDimL = Content.Load<Texture2D>("UI/button-dim-left");
            pauseMenuIconDimR = Content.Load<Texture2D>("UI/button-dim-right");
            pauseMenuIconDimC = Content.Load<Texture2D>("UI/button-dim-middle");
            pauseMenuIconLitL = Content.Load<Texture2D>("UI/button-lit-left");
            pauseMenuIconLitR = Content.Load<Texture2D>("UI/button-lit-right");
            pauseMenuIconLitC = Content.Load<Texture2D>("UI/button-lit-middle");

            // UI buttons
            pauseButtonDim = Content.Load<Texture2D>("UI/pause-dim");
            pauseButtonLit = Content.Load<Texture2D>("UI/pause-lit");
            UIButton pause = new UIButton(new Vector2(950, 700), this.Content, UIButton.Button.pauseButton, true, -1);
            pause.OnClick += Pause_OnClick;
            buttons.Add(pause);

            int initialX = (graphics.GraphicsDevice.Viewport.Width / 2) - ((mainMenuIconDimL.Width + mainMenuIconDimR.Width + centerIconWidth)/ 2);
            int initialY = (graphics.GraphicsDevice.Viewport.Height / 4) + 75;

            // Set up Main Menu.   
            mainMenuItems[0] = new MenuSelection("Play", pauseMenuIconDimL, pauseMenuIconDimR, pauseMenuIconDimC,
                pauseMenuIconLitL, pauseMenuIconLitR, pauseMenuIconLitC, initialX, initialY, centerIconWidth, lithosProMenu);
            mainMenuItems[1] = new MenuSelection("Instructions", pauseMenuIconDimL, pauseMenuIconDimR, pauseMenuIconDimC,
                pauseMenuIconLitL, pauseMenuIconLitR, pauseMenuIconLitC, initialX, initialY + 90, centerIconWidth, lithosProMenu);
            mainMenuItems[2] = new MenuSelection("Credits", pauseMenuIconDimL, pauseMenuIconDimR, pauseMenuIconDimC,
                pauseMenuIconLitL, pauseMenuIconLitR, pauseMenuIconLitC, initialX, initialY + 180, centerIconWidth, lithosProMenu);
            mainMenuItems[3] = new MenuSelection("Exit", pauseMenuIconDimL, pauseMenuIconDimR, pauseMenuIconDimC,
                pauseMenuIconLitL, pauseMenuIconLitR, pauseMenuIconLitC, initialX, initialY + 270, centerIconWidth, lithosProMenu);
            
            // Set up Pause Menu.
            initialY = (graphics.GraphicsDevice.Viewport.Height / 4) + 25;
            pauseMenuItems[0] = new MenuSelection("Resume Game", mainMenuIconDimL, mainMenuIconDimR, mainMenuIconDimC,
                mainMenuIconLitL, mainMenuIconLitR, mainMenuIconLitC, initialX, initialY, centerIconWidth, lithosProMenu);
            pauseMenuItems[1] = new MenuSelection("Help", mainMenuIconDimL, mainMenuIconDimR, mainMenuIconDimC,
                mainMenuIconLitL, mainMenuIconLitR, mainMenuIconLitC, initialX, initialY + 90, centerIconWidth, lithosProMenu);
            pauseMenuItems[2] = new MenuSelection("Return to Title", mainMenuIconDimL, mainMenuIconDimR, mainMenuIconDimC,
                mainMenuIconLitL, mainMenuIconLitR, mainMenuIconLitC, initialX, initialY + 180, centerIconWidth, lithosProMenu);
            pauseMenuItems[3] = new MenuSelection("Exit", mainMenuIconDimL, mainMenuIconDimR, mainMenuIconDimC,
                mainMenuIconLitL, mainMenuIconLitR, mainMenuIconLitC, initialX, initialY + 270, centerIconWidth, lithosProMenu);

            // Misc
            advancedHelpIndicator0 = Content.Load<Texture2D>("UI/LvL2_PopUp");
            advancedHelpIndicator1 = Content.Load<Texture2D>("UI/Help");
            advancedHelpIndicator2 = Content.Load<Texture2D>("UI/Tutorial3");

            // SFX
            sfx_menuSelection = Content.Load<SoundEffect>("SFX/menu selection");
            sfx_gameWin = Content.Load<SoundEffect>("SFX/Game Win");
            sfx_endGame = Content.Load<SoundEffect>("SFX/End Game");

            //Introduction Sequence.
            finalIntroFrame = Content.Load<Texture2D>("IntroSequence/intro-final-frame");
            cloud1 = Content.Load<Texture2D>("IntroSequence/title-cloud1");
            cloud2 = Content.Load<Texture2D>("IntroSequence/title-cloud2");
            cloud3 = Content.Load<Texture2D>("IntroSequence/title-cloud3");
            cloud4 = Content.Load<Texture2D>("IntroSequence/title-cloud4");
            forest1 = Content.Load<Texture2D>("IntroSequence/title-forest1");
            forest2 = Content.Load<Texture2D>("IntroSequence/title-forest2");
            forest3 = Content.Load<Texture2D>("IntroSequence/title-forest3");
            forest4 = Content.Load<Texture2D>("IntroSequence/title-forest4");
            ground = Content.Load<Texture2D>("IntroSequence/title-ground");
            logo = Content.Load<Texture2D>("IntroSequence/title-logo");
            mountains = Content.Load<Texture2D>("IntroSequence/title-mountains");
            sea = Content.Load<Texture2D>("IntroSequence/title-sea");
            sky = Content.Load<Texture2D>("IntroSequence/title-sky");
            volcano = Content.Load<Texture2D>("IntroSequence/title-volcano");
        }
Exemplo n.º 6
0
 public void Pause_OnClick(UIButton source)
 {
     IsPaused = true;
     //System.Diagnostics.Debug.WriteLine("Pausing game.");
 }