getting right or left from two angles

For questions about using Classic.

Post » Mon Aug 02, 2010 6:11 pm

I have no idea how most those math stuff works.

But i would like to compare two angles, both from the same object, but one angle is 100 miliseconds away, so basicly its two different angles if the object changed the angle.

To see which way did the object turn to, left or right.
B
3
G
4
Posts: 54
Reputation: 1,183

Post » Mon Aug 02, 2010 7:38 pm

Can't you just check it with the previous tick angle?
Why do you need to see the future? as seeing the future can be complicated depending on the case
B
2
G
4
Posts: 43
Reputation: 1,136

Post » Mon Aug 02, 2010 8:00 pm

nah its actually the past, iv already set up the event i have both angles but i have no idea what condition to use to see if he camed from right or left.
B
3
G
4
Posts: 54
Reputation: 1,183

Post » Mon Aug 02, 2010 9:50 pm

Hi. It's best to think (anti)clockwise with angles. Construct goes from right-facing at 0 degrees, clockwise as the angle increases.

The math is a bit of a pain when having to deal with the transition at 360/0, but Construct already has a condition for this in the System object, way at the bottom, under 'Values' - 'Angle is clockwise of...'

You can test for either clockwise or anticlockwise, but it's best to only test if you've determined that the angle has changed, because it tests true with no change.

I made a quick example here:

[url:3hx1lvj6]http://dl.dropbox.com/u/5868916/Angles.cap[/url:3hx1lvj6]
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Mon Aug 02, 2010 10:14 pm

Thanks, that is just what i needed. It works perfectly.
B
3
G
4
Posts: 54
Reputation: 1,183


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests