How do I make 2 Joysticks

Get help using Construct 2

Post » Sun Feb 01, 2015 10:34 am

Hello,
I made a joystick for movement and i want an other one for angle.
Ex:
i must make it to go in a direction (Joystick1)
and to shoot in an other direction (Joystick2)
I have tried :
Every tick > set player angle > Joystick2.angle
It didn't work.
Help?
P.S. I made a example fast but i need help to introduce the second joystick
Thanks
You do not have the required permissions to view the files attached to this post.
B
11
S
3
Posts: 277
Reputation: 1,395

Post » Sun Feb 01, 2015 10:40 am

I actually have a file for that! Its designed to work with a physical controller, but the code translates quite readily. Its a bit messy, but I highlighted the important parts in the image.

Ignore the ugly background. It turns out the texture brought the file up over the 2 meg limit.

Basically, the function you need is Angle. It takes 2 points, so if you're making a touch joystick take the origin of the joystick as point 1, and the location of the touch as point 2. angle(JoyOriginx,JoyOriginY,TouchX,TouchY) .
You do not have the required permissions to view the files attached to this post.
B
6
Posts: 16
Reputation: 284

Post » Sun Feb 01, 2015 6:36 pm

@saumanahaii
Nice Game , ;)
Look I almost made it but i have a problem with the touch.
i don't know why it goes left and the joystick from movement is going to the joystick to the angle.
Could you repair my crash?
Thanks a lot!
You do not have the required permissions to view the files attached to this post.
B
11
S
3
Posts: 277
Reputation: 1,395

Post » Mon Feb 02, 2015 6:38 pm

@ anty21ro
Saw,that youre online, could you possible help me?
B
11
S
3
Posts: 277
Reputation: 1,395


Return to How do I....?

Who is online

Users browsing this forum: blue visionary, rengo and 35 guests