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
S
2
Posts: 105
Reputation: 889

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
60
S
30
G
132
Posts: 1,932
Reputation: 74,341

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
178
S
50
G
206
Posts: 8,684
Reputation: 127,711


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests