public override void HandleInput(Microsoft.Xna.Framework.GameTime gameTime, Framework.CInput _Input) { if (_Input.KeyPressed(Microsoft.Xna.Framework.Input.Keys.Space) || j < 0) { //CResourceManager.GetInstance().GetSoundEffect(IDResource.SFX_INTRO).Dispose(); MediaPlayer.Stop(); StateManager.getInst().ExitScreen(); StateManager.getInst().AddScreen(new MenuState(IDGameState.MENU)); } base.HandleInput(gameTime, _Input); }
public override void HandleInput(Microsoft.Xna.Framework.GameTime gameTime, Framework.CInput _Input) { #region Move icon if (CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y >= 120 && CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y <= 180) { if (_Input.KeyPressed(Microsoft.Xna.Framework.Input.Keys.Down)) { SoundManager.PlaySound(ESound.SFX_COIN); if (CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y == 180) CResourceManager.GetInstance().GetResource(IDResource.ICON).Position = new Vector2(110, 120); else { CResourceManager.GetInstance().GetResource(IDResource.ICON).Position = new Vector2(CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.X, CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y + 30); } } if (_Input.KeyPressed(Microsoft.Xna.Framework.Input.Keys.Up)) { SoundManager.PlaySound(ESound.SFX_COIN); if (CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y == 120) CResourceManager.GetInstance().GetResource(IDResource.ICON).Position = new Vector2(110, 180); else { CResourceManager.GetInstance().GetResource(IDResource.ICON).Position = new Vector2(CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.X, CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y - 30); } } } #endregion #region BtnStatuts if (_Input.KeyPressed(Microsoft.Xna.Framework.Input.Keys.Enter) || _Input.KeyPressed(Microsoft.Xna.Framework.Input.Keys.Space)) { if (CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y == 120) { GlobalSetting.IsSoundEffect = !GlobalSetting.IsSoundEffect; } if (CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y == 150) { GlobalSetting.IsSoundBG = !GlobalSetting.IsSoundBG; SoundManager.MuteSong(); } if (CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y == 180) { StateManager.getInst().ExitScreen(); StateManager.getInst().AddScreen(new MenuState(IDGameState.MENU)); } } if (CResourceManager.GetInstance().GetResource(IDResource.ICON).Position.Y == 180) { ListButtons[2].Focus = true; } else ListButtons[2].Focus = false; if (GlobalSetting.IsSoundEffect) ListButtons[0].Focus = true; else ListButtons[0].Focus = false; if (GlobalSetting.IsSoundBG) ListButtons[1].Focus = true; else ListButtons[1].Focus = false; #endregion base.HandleInput(gameTime, _Input); }