How do I get a specific touch index coordinates?

Get help using Construct 2

Post » Wed Jun 08, 2016 7:05 pm

I have this event sheet

Image

I'm trying to create a dpad for my spaceship.

It works just fine when the only touch is on the DPad, but when I touch the screen, and then the DPad at the same time, the spaceship doesn't move as wanted...

I've also tried adding another condition in event 2 comparing Touch.TouchIndex to TouchIndex variable, but didn't help as well...

Any idea? I would like to move the space at the angle calculated by the TouchIndex I already saved...

Thanks!
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Post » Wed Jun 08, 2016 7:17 pm

On nth touch, is nth touch.
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Wed Jun 08, 2016 7:23 pm

Thanks, but I can't see "is nth touch" or "on nth touch" in the conditions list. There's "Has nth touch" but in my case that will always be true...
I've tried adding Compare Variable TouchIndex Equal To Touch.TouchIndex, that didn't work as well...

Attaching the capx here:

http://ge.tt/2xEpUGb2
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Post » Wed Jun 08, 2016 8:07 pm

Index 0 is dpad, 1 is ship.
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Wed Jun 08, 2016 8:30 pm

Sorry, but I couldn't really understand what you're tying to say...
Could you please elaborate on the issue?
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Post » Wed Jun 08, 2016 9:31 pm

Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Thu Jun 09, 2016 5:29 pm

Thanks, but this doesn't work if I touch somewhere on the screen and a second touch on the dpad...
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Post » Thu Jun 09, 2016 9:38 pm

I've updated it to do something if there is a second touch.
I can only guess at what you want it to do.
Nonspecific questions get non specific answers.
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Thu Jun 09, 2016 10:06 pm

B
33
S
18
G
27
Posts: 2,431
Reputation: 20,326

Post » Fri Jun 10, 2016 4:43 am

newt, sorry if I have been cryptic but I wrote my exact issue in the first post... I'm trying to create a dpad for my ship. it works, but when clicking the fire button first and then the dpad, I can't detect which touch is the dpad one...
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Next

Return to How do I....?

Who is online

Users browsing this forum: mrkaio, Zav and 2 guests