[R102] how to use AngleAt?

Get help using Construct 2

Post » Tue Sep 11, 2012 9:55 am

Hi, I have been detecting swipe left/right/up/down the old manual way.

I see there is an AngleAt and a "compare touch speed".

How does one use AngleAt? Its not in the touch objects actions, and its not a valid expression if you say "compare two values" and put in AngleAt.

What is the parameter for "Compare touch Speed". Is it m/s, km/h, pixels/s or similar? I.e. what should I put in there to detect any kind of swipe, e.g. >0?

Thanks!
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Tue Sep 11, 2012 11:17 am

You definitely can use this expression in 'compare two values'. What error did you get?

AngleAt takes a single number parameter which is the index of the touch to get. Touch.AngleAt(0) returns the angle in degrees of the first touch, Touch.AngleAt(1) returns the angle of the second touch, etc.

The description for the 'speed' parameter says the units is in "absolute pixels per second". It appears at the top of the dialog when you select the parameter. This means pixels per second on the canvas, which basically is saying it doesn't change depending on if you scale the game really large or small.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt and 22 guests