How do I create the multi touch control for mobile?

Get help using Construct 2

Post » Thu Apr 20, 2017 4:17 am

I am making side shooter game, when I touch shooting button, the player is moving towards x axis, Ideally the player should move with joystick.

I found this issue when I testing on mobile.

I have placed the capx file on dropbox

https://www.dropbox.com/s/djp55ub9vahs0 ... .capx?dl=0
B
41
S
9
G
1
Posts: 79
Reputation: 2,745

Post » Thu Apr 20, 2017 8:10 am

@radhaw

the problem is the joystick is only looking for "Is in touch". So, when you touch Sprite4 to fire, that will also affect the joystick, because "Is in touch" is true.

To do a proper multi touch interface, you have to track each start and end of each touch by their index. It gets pretty tricky but is possible.

for your example, you can (mostly) get it to do what you want by adding another condition to both event 3 and 4 that says:

Touch > Not is touching Sprite4

( to do a Not, add a condition that says Touch > Is touching Sprite4 and then right-click it and choose invert )

The only problem I had with this simplified multi touch, is that the joystick stops responding if you hold your finger on the fire button (sprite4).
B
99
S
35
G
20
Posts: 438
Reputation: 17,910

Post » Thu Apr 20, 2017 8:25 am

A relatively simple fix would be to put a large invisible sprite over the area that you want to register analogue stick input and do your input check on that. Unless you're planning on adding in extra buttons, I'd probably do the same for the shoot button as well so that the user doesn't miss the shoot inputs.
B
22
S
9
G
4
Posts: 476
Reputation: 4,327

Post » Thu Apr 20, 2017 8:33 am

B
22
S
9
G
4
Posts: 476
Reputation: 4,327

Post » Thu Apr 20, 2017 7:06 pm

Thanks a lot guys, I will try your suggestions. :D
B
41
S
9
G
1
Posts: 79
Reputation: 2,745


Return to How do I....?

Who is online

Users browsing this forum: mariogamer and 6 guests