Joystick First Example

Thanks Ignatz! I put your code into a new project to test it, and it’s running like it’s in slow motion - just thought I’d let you know. I’m on an iPad Pro, so it’s the latest hardware. Can you test it and see how it runs for you?

Here’s a video I took of it in action. I’m not moving my thumb slowly - it’s as fast as the controller is going for me.

@interactivenyc It’s not your iPad. The joystick is slow on my iPad as well.

@interactivenyc - you’ll see that the velocity is adjusted by 1/20 of the change in joystick position.

Make it bigger, eg 1/5, and you will see a big difference

It’s up to you what you do with the value returned by the joystick class, which is between -1 and -+1

To clarify a little further, this joystick class doesn’t change your object position. It simply gives you back the location of the joystick. Your main code then decides what to do with it.

In my example, I use the joystick not to directly move the circle, but to change its speed very gently. You can of course do something completely different with it.

It’s not that the circle moves too slowly, but the position of the joystick. Is there a way to speed that part up?

self.mspeed is set to 30. Make it large, eg 1000

Much better!