Suggestion: anglediff with sign

Discussion and feedback on Construct 2

Post » Wed Mar 26, 2014 11:28 pm

Hi,
just a little suggestion:
The anglediff(ang1,ang2) function works fine, but its a abs value without sign.
Please add a checkbox in this functionwindow for sign or abs (unsigned).
Why? For example for object moving in to directions.
angDiff += angleDiff(ang1,ang2)/10; //smooth moving to ang1
Pos.x = mid.x + sin(angDIff)*128;
Pos.y = mid.y + cos(angDIff)*128;

Here is a alternative script for singed angle diff:
angleDiff = ((((ang1- ang2) % 360) + 540) % 360) - 180;
B
13
S
4
G
1
Posts: 107
Reputation: 1,337

Post » Sat Mar 26, 2016 8:55 am

Thanks so much. Very useful!
B
9
S
2
Posts: 12
Reputation: 1,125

Post » Fri Sep 22, 2017 8:50 pm

This is amazing. Thank You.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
64
S
19
G
90
Posts: 1,119
Reputation: 59,667


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests