Exemplo n.º 1
0
 public void Reset()
 {
     if (currentGameState != null)
     {
         currentGameState.Reset();
     }
 }
Exemplo n.º 2
0
 public override void HandleInput(InputHelper inputHelper)
 {
     if (!inputHelper.KeyPressed(Keys.Space))
     {
         return;
     }
     playingState.Reset();
     GameEnvironment.GameStateManager.SwitchTo("playingState");
 }
Exemplo n.º 3
0
    public override void Reset()
    {
        settings.Reset();
        titleMenuState.Reset();

        musicSlider.Value       = GameSettings.MusicVolume;
        soundEffectSlider.Value = GameSettings.SoundVolume;
        voiceOverSlider.Value   = GameSettings.VoiceVolume;

        fullscreen.Check = GameSettings.Fullscreen;
        vsync.Check      = GameSettings.VSync;

        apply.Position = new Vector2(-1000, -1000);
    }
Exemplo n.º 4
0
 public override void HandleInput(InputHelper inputHelper)
 {
     base.HandleInput(inputHelper);
     if (retryButton.Pressed)
     {
         GameEnvironment.GameStateManager.SwitchTo("playingState");
         IGameLoopObject playingState = GameEnvironment.GameStateManager.CurrentGameState;
         playingState.Reset();
     }
     if (quitButton.Pressed)
     {
         IGameLoopObject playingState = GameEnvironment.GameStateManager.CurrentGameState;
         playingState.Reset();
         this.Reset();
         GameEnvironment.GameStateManager.SwitchTo("levelMenu");
     }
 }
    /// <summary>
    /// Handles input for the pause state
    /// </summary>
    public void HandleInput(InputHelper inputHelper)
    {
        continueButton.HandleInput(inputHelper);
        quitButton.HandleInput(inputHelper);
        if (continueButton.Pressed)
        {
            GameEnvironment.AssetManager.PlaySound("Assets/SFX/button_click");
            FullBrickEpicDungeon.DungeonCrawler.mouseVisible = false;
            GameEnvironment.GameStateManager.SwitchTo("playingState");
        }

        else if (quitButton.Pressed)
        {
            GameEnvironment.AssetManager.PlaySound("Assets/SFX/button_click");
            playingState.Reset();
            FullBrickEpicDungeon.DungeonCrawler.mouseVisible = true;
            GameEnvironment.GameStateManager.SwitchTo("titleMenu");
        }
    }
Exemplo n.º 6
0
    public override void HandleInput(InputHelper inputHelper)
    {
        base.HandleInput(inputHelper);
        if (quitButton.Pressed)
        {
            IGameLoopObject playingState = GameEnvironment.GameStateManager.CurrentGameState;
            playingState.Reset();
            this.Reset();
            GameEnvironment.GameStateManager.SwitchTo("levelMenu");
        }
        if (retryButton.Pressed)
        {
            GameEnvironment.GameStateManager.SwitchTo("playingState");
            IGameLoopObject playingState = GameEnvironment.GameStateManager.CurrentGameState;
            playingState.Reset();
        }
        UI ui = this.Find("ui") as UI;

        if ((inputHelper.MouseLeftButtonPressed() && (Math.Sqrt((inputHelper.MousePosition.X - 750) * (inputHelper.MousePosition.X - 750) + (inputHelper.MousePosition.Y - 105) * (inputHelper.MousePosition.Y - 105)) < 100) || inputHelper.KeyPressed(Keys.T)) && !holding && ui.Money >= 20)
        {
            Tower tower = new Tower();
            towerList.Add(tower);
            holding   = true;
            ui.Money -= 20;
        }
        if (ui.spawnVirus)
        {
            if ((inputHelper.MouseLeftButtonPressed() && inputHelper.MousePosition.X > 900 && inputHelper.MousePosition.X <= 1000 && inputHelper.MousePosition.Y > 16 && inputHelper.MousePosition.Y < 190) || inputHelper.KeyPressed(Keys.F) && !holding && ui.Money >= 20)
            {
                Firewall firewall = new Firewall();
                firewallList.Add(firewall);
                holding   = true;
                ui.Money -= 20;
            }
        }
        if (inputHelper.KeyPressed(Keys.M))
        {
            ui.Money += 1000;
        }
    }
Exemplo n.º 7
0
 public void Reset()
 {
     playingState.Reset();
     hud.Reset();
 }
Exemplo n.º 8
0
 public override void Reset()
 {
     hud.Reset();
     base.Reset();
 }