Invert controls

From the Asset Store
Supports keyboard, mouse and gamepads. Supports several gamepads at once.
  • Hi guys,

    Trying to add inverted controls to my game that uses impulse to launch the player like a sling shot. However, a couple people who have tested it would like to test with inverted controls - i.e instead of pulling back to propel the character forwards, they would like to try swiping in the direction they would like to send the character.

    Been fiddling with this for a good few hours now but cant seem to crack it. So here is the initial code to move the character forward, and an image to show how the movement works.

    I have tried various things to get this working but none are working so far. At the moment, I have added another ball to mirror the touch, and tried to get the impulse to cause the character to move from the rear, while the first ball is facing the direction of player movement.

    Appreciate any pointers.

    Cheers

  • Any advice? Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Um, you could use Touch's AngleAt(index)

    You might need to make sure that the speed (SpeedAt(index)) is greater than zero. Otherwise there is no angle.

    Otherwise just subtract 180 from the angle(x1,y1,x2,y2)

  • Got it - I was changing the wrong angle and focusing on trying to change the impulse direction. Was really simple - innerBall - Set angle to angle(Touch.X,Touch.Y,innerBall2.X,innerBall2.Y) + 180 and sorted. Thanks for the brain wave newt

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)