Example #1
0
        /*
         * Draws the choosen popup with the buttons
         */
        public void DisplayPopUp(SpectrumEnums.popUpId id)
        {
            // maybe a popup manager, to dispose popups after being x.
            switch (id)
            {
                case SpectrumEnums.popUpId.win:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.win);
                    break;
                case SpectrumEnums.popUpId.lose:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.lose);
                    break;
                case SpectrumEnums.popUpId.custom:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.custom, "Not enough Ink", "You need to collect all the ink\n in order to proceed to the next level.\nGoogoos (enemies) also give ink!");
                    break;
                case SpectrumEnums.popUpId.musicSettings:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.musicSettings);
                    break;
                case SpectrumEnums.popUpId.deleteSaveFile:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.deleteSaveFile);
                    break;
                case SpectrumEnums.popUpId.gameAnalytics:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.gameAnalytics);
                    break;
                default:
                    break;
            }

            displayedPopUp.Draw(spriteBatch);
        }
Example #2
0
        /*
         * Draws the choosen popup with the buttons
         */
        public void DisplayPopUp(SpectrumEnums.popUpId id)
        {
            // maybe a popup manager, to dispose popups after being x.
            switch (id)
            {
                case SpectrumEnums.popUpId.win:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.win);
                    break;
                case SpectrumEnums.popUpId.lose:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.lose);
                    break;
                case SpectrumEnums.popUpId.custom:
                    displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.custom, "Not enough Ink", "You need to collect all the ink in order to proceed to the next level.");
                    break;
                default:
                    break;
            }

            displayedPopUp.Draw(spriteBatch);
        }
Example #3
0
 public void setParent(PopUp parent)
 {
     foreach (Button but in buttons)
     {
         but.setParentPopUp(parent);
     }
 }
Example #4
0
 public void setParentPopUp(PopUp popUp)
 {
     parent = popUp;
 }
Example #5
0
        /*
         * Main Draw Method, decides what needs to be drawn given the current gameState
         */
        public void Draw()
        {
            spriteBatch.Begin();
            displayedPopUp = null;
            modelManager.buttonHandler.RemoveAll();

            switch (Spectrum.currentGameState)
            {
                case SpectrumEnums.GameState.Start:
                    DrawStartScreen();
                    break;
                case SpectrumEnums.GameState.MainMenu:
                    resetScore();
                    DrawMainMenu();
                    break;
                case SpectrumEnums.GameState.SettingsMenu:
                    DrawSettingsMenu();
                    break;
                case SpectrumEnums.GameState.LevelSelection:
                    DrawActSelection();
                    break;
                case SpectrumEnums.GameState.LoadLevel:
                    modelManager.unloadLevel();
                    DrawLevel();
                    Spectrum.currentGameState = SpectrumEnums.GameState.InGame;
                    break;
                case SpectrumEnums.GameState.InGame:
                    DrawInGameHUD();
                    if (Spectrum.isGameInterrupted)
                    {
                        DisplayPopUp(currentPopUpId);
                    }
                    break;
                case SpectrumEnums.GameState.GameOver:
                    DrawEndScreen();
                    break;
            }
            modelManager.buttonHandler.Draw(spriteBatch);

            spriteBatch.End();

            graphics.BlendState = BlendState.Opaque;
            graphics.DepthStencilState = DepthStencilState.Default;
            graphics.SamplerStates[0] = SamplerState.LinearWrap;
        }
Example #6
0
 /*
  *Draws the Settings menu
  */
 protected void DrawSettingsMenu()
 {
     displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.settingsMenu);
     displayedPopUp.Draw(spriteBatch);
 }
Example #7
0
 /*
  * Draws the Act and Level Selection menu
  */
 protected void DrawActSelection()
 {
     displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.levelSelection);
     displayedPopUp.Draw(spriteBatch);
 }
Example #8
0
        /*
         * Main Draw Method, decides what needs to be drawn given the current gameState
         */
        public void Draw()
        {
            displayedPopUp = null;
            modelManager.buttonHandler.RemoveAll();

            switch (Spectrum.currentGameState)
            {
                case SpectrumEnums.GameState.Start:
                    DrawStartScreen();
                    break;
                case SpectrumEnums.GameState.MainMenu:
                    resetScore();
                    DrawMainMenu();
                    break;
                case SpectrumEnums.GameState.SettingsMenu:
                    DrawSettingsMenu();
                    if (Spectrum.isGameInterrupted)
                    {
                        DisplayPopUp(currentPopUpId);
                    }
                    break;
                case SpectrumEnums.GameState.LevelSelection:
                    DrawActSelection();
                    break;
                case SpectrumEnums.GameState.LoadLevel:
                    modelManager.unloadLevel();
                    DrawLevel();
                    Spectrum.currentGameState = SpectrumEnums.GameState.InGame;
                    break;
                case SpectrumEnums.GameState.InGame:
                    DrawInGameHUD();
                    if (Spectrum.isGameInterrupted)
                    {
                        DisplayPopUp(currentPopUpId);
                    }
                    justDied = false;
                    break;
                case SpectrumEnums.GameState.GameOver:
                    DrawEndScreen();
                    break;
            }
            modelManager.buttonHandler.Draw(spriteBatch);
        }