How do I set 8 direction movment with on screen controls

Get help using Construct 2

Post » Wed Jul 13, 2016 7:59 pm

i have got 4 onscreen controls IE, UP DOWN LEFT RIGHT but want the 8 direction implemented whilst touching them controls
B
7
Posts: 52
Reputation: 381

Post » Wed Jul 13, 2016 9:55 pm

Use the angle value between the center/origin of your OSC and your touch coordinate, then separate out 8 conditions for each angle range you want.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Post » Wed Jul 13, 2016 10:08 pm

oosyrag wrote:Use the angle value between the center/origin of your OSC and your touch coordinate, then separate out 8 conditions for each angle range you want.


int(angle(x1,y1,x2,y2)/8)= 1, simulate right

int(angle(x1,y1,x2,y2)/8)= 45, simulate right, simulate down

int(angle(x1,y1,x2,y2)/8)= 90, simulate down

...etc
Image ImageImage
B
168
S
50
G
163
Posts: 8,224
Reputation: 105,067


Return to How do I....?

Who is online

Users browsing this forum: Alvaro2, Yahoo [Bot] and 16 guests