예제 #1
0
        private void OnDownPress(object source, MoveInputEventArgs args)
        {
            if (Movement == MovementType.Climb)
            {
                float deltaTime         = (float)Global.GameTime.ElapsedGameTime.TotalSeconds;
                float velocityRate      = MoveSpeed * deltaTime;
                float adjustedMoveSpeed = (int)Math.Round(args.InputValue * velocityRate);
                Velocity = Velocity + new Vector2(0, adjustedMoveSpeed);

                if (AnimationManager.Animation != AnimationLibrary["climbLadder"])
                {
                    AnimationManager.Play(AnimationLibrary["climbLadder"]);
                }
            }
        }
예제 #2
0
        private void OnUpPressed(object source, MoveInputEventArgs args)
        {
            if (InputTimer <= 0)
            {
                if (SelectedItem == 0)
                {
                    SelectedItem = LastItem;
                    Items.ElementAt(0).Deselect();
                    Items.ElementAt(SelectedItem).Select();
                }
                else
                {
                    Items.ElementAt(SelectedItem).Deselect();
                    SelectedItem -= 1;
                    Items.ElementAt(SelectedItem).Select();
                }

                InputTimer = 0.25f;
            }
        }