Beispiel #1
0
        async Task CheckInput(int tick)
        {
            if (tick % (21 - game.Level) == 0)
            {
                game.OnDown(true);
            }

            var pos = await joystick.GetPosition();

            if (pos == AnalogJoystick.DigitalJoystickPosition.Left)
            {
                game.OnLeft();
            }
            if (pos == AnalogJoystick.DigitalJoystickPosition.Right)
            {
                game.OnRight();
            }
            if (pos == AnalogJoystick.DigitalJoystickPosition.Up)
            {
                game.OnRotate();
            }
            if (pos == AnalogJoystick.DigitalJoystickPosition.Down)
            {
                game.OnDown();
            }
        }
        void CheckInput(int tick)
        {
            if (tick % (21 - game.Level) == 0)
            {
                game.OnDown(true);
            }

            var pos = joystick.DigitalPosition;

            if (pos == DigitalJoystickPosition.Left)
            {
                game.OnLeft();
            }
            if (pos == DigitalJoystickPosition.Right)
            {
                game.OnRight();
            }
            if (pos == DigitalJoystickPosition.Up)
            {
                game.OnRotate();
            }
            if (pos == DigitalJoystickPosition.Down)
            {
                game.OnDown();
            }
        }
Beispiel #3
0
        void CheckInput(int tick)
        {
            if (tick % (21 - game.Level) == 0)
            {
                game.OnDown(true);
            }

            if (portLeft.State == true)
            {
                game.OnLeft();
            }
            else if (portRight.State == true)
            {
                game.OnRight();
            }
            else if (portUp.State == true)
            {
                game.OnRotate();
            }
            else if (portDown.State == true)
            {
                game.OnDown();
            }
        }