public override void HandleInput(InputState input)
 {
     if (input.IsInput(Inputs.MenuAccept, ControllingPlayer)) {
         GameSession.Current.MenuAccept.Play(GameSession.Current.SoundEffectVolume, 0, 0);
         if (DialogueBox.Text.FullyTyped) ExitScreen();
         else DialogueBox.Text.FullyTyped = true;
     }
 }
Example #2
0
 public override void HandleInput(InputState input)
 {
     PlayerIndex playerIndex;
     if (input.IsInput(Inputs.PressStart, null, out playerIndex)) {
         GameSession.Current.PressStart.Play(GameSession.Current.SoundEffectVolume, 0, 0);
         ExitScreen();
         ScreenManager.AddScreen(new MainMenu(), playerIndex);
     }
 }
Example #3
0
 public override void HandleInput(InputState input)
 {
     if (input.IsInput(Inputs.MenuAccept, ControllingPlayer)) {
         GameSession.Current.MenuAccept.Play(GameSession.Current.SoundEffectVolume, 0, 0);
         item = Item.Generate(GameSession.Random.Next(1, 50), GameSession.Random);
     }
     if (input.IsInput(Inputs.MenuCancel, ControllingPlayer)) {
         //GameSession.Current.StartFromSplashScreens();
         ExitScreen();
     }
 }
Example #4
0
 public override void HandleInput(InputState input)
 {
     if (input.IsInput(Inputs.GamePause, ControllingPlayer)) ScreenManager.AddScreen(new PauseScreen(), ControllingPlayer);
     if (InputState.InputMethod == InputMethods.Gamepad) {
         //player.Position += input.LeftThumbstick(ControllingPlayer).ToVector3() * 8;
         player.MoveInDirection(input.LeftThumbstick(ControllingPlayer).ToVector3(), player.MoveSpeed);
         player.IntendedPosition = player.Position;
         if (player.Position != player.LastPosition) player.TurnTowardsIntended();
     }
     else {
         if (input.IsNewMousePress(MouseButtons.Left)) {
             player.IntendedPosition = stage.MouseCoordinates;
             for (int i = 0; i < stage.Objects.Count; i++) {
                 Rectangle bb = stage.Objects[i].BoundingBox;
                 Vector2 dest = stage.Objects[i].Position.Round().ToVector2();// - stage.ViewOffset.Round();
                 bb.X += (int)dest.X;
                 bb.Y += (int)dest.Y;
                 if (bb.Contains(new Point((int)stage.MouseCoordinates.X, (int)stage.MouseCoordinates.Z)) && stage.Objects[i] is Actor && stage.Objects[i] != player && Vector3.Distance(player.Position, stage.Objects[i].Position) < 128) ((Actor)stage.Objects[i]).Kill();
             }
             //player.MoveTowardsIntended();
         }
     }
 }
Example #5
0
 public override void HandleInput(InputState input)
 {
     base.HandleInput(input);
     if (input.IsInput(Inputs.GamePause, ControllingPlayer)) ScreenManager.AddScreen(new PauseScreen(), ControllingPlayer);
 }
Example #6
0
        public override void HandleInput(InputState input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            if (input.IsInput(Inputs.MenuDown, ControllingPlayer)) {
                do {
                    selectedIndex++;
                    if (selectedIndex >= entries.Count) selectedIndex -= entries.Count;
                }
                while (!entries[selectedIndex].Enabled);
                GameSession.Current.MenuCursor.Play(GameSession.Current.SoundEffectVolume, 0, 0);
            }

            if (input.IsInput(Inputs.MenuUp, ControllingPlayer)) {
                do {
                    selectedIndex--;
                    if (selectedIndex < 0) selectedIndex += entries.Count;
                }
                while (!entries[selectedIndex].Enabled);
                GameSession.Current.MenuCursor.Play(GameSession.Current.SoundEffectVolume, 0, 0);
            }

            if (entries[selectedIndex].Content != null) Content = entries[selectedIndex].Content;
            else Content = null;

            PlayerIndex playerIndex;
            if (input.IsInput(Inputs.MenuAccept, ControllingPlayer, out playerIndex)) {
                if (entries[selectedIndex].IsCancel) GameSession.Current.MenuCancel.Play(GameSession.Current.SoundEffectVolume, 0, 0);
                else if (entries[selectedIndex].HasSelected) GameSession.Current.MenuAccept.Play(GameSession.Current.SoundEffectVolume, 0, 0);
                else GameSession.Current.MenuDeny.Play(GameSession.Current.SoundEffectVolume, 0, 0);
                OnSelectEntry(selectedIndex, playerIndex);
            }
            if (input.IsInput(Inputs.MenuLeft, ControllingPlayer, out playerIndex)) {
                if (entries[selectedIndex].HasSwipeLeft) GameSession.Current.MenuCursor.Play(GameSession.Current.SoundEffectVolume, 0, 0);
                OnSwipeLeftEntry(selectedIndex, playerIndex);
            }
            if (input.IsInput(Inputs.MenuRight, ControllingPlayer, out playerIndex)) {
                if (entries[selectedIndex].HasSwipeRight) GameSession.Current.MenuCursor.Play(GameSession.Current.SoundEffectVolume, 0, 0);
                OnSwipeRightEntry(selectedIndex, playerIndex);
            }
            if (input.IsInput(Inputs.MenuCancel, ControllingPlayer, out playerIndex) && Cancelable) {
                GameSession.Current.MenuCancel.Play(GameSession.Current.SoundEffectVolume, 0, 0);
                OnCancel(playerIndex);
            }
        }
Example #7
0
 public virtual void HandleInput(InputState input)
 {
 }