How do I detect and apply angles.

Get help using Construct 2

» Sun Nov 30, 2014 8:20 pm

Hi

I am in the process of making a sailboat game. I have problem detecting when the wind is coming from the Left side or Right side of the ships center axis.

No matter what direction you point the ship. The nose of the ship is always "Zero rotation" and from that, I want to measure/detect what angle the wind is coming from. And if its more than 180 degrees it will be coming from Left side and if less from Right side. Not sure how to write that in math. Im sure someone who is good at math can write an expression that does it but if any one can point me in the right direction i would be much appreciated.

My best result so far is using anglediff but it only shows the shortest angle so cant use the numbers to tell if its from left or right side.

Cheers
John
B
16
S
3
Posts: 12
Reputation: 881

» Sun Nov 30, 2014 9:17 pm

Solved it by putting on the Wind indicator/angle a within 180 degrees of Sailboat.Angle.
And then a Sailboat is Clockwise from Wind.Angle.

If people have other solutions I am more than happy to hear them.

Thanks
You do not have the required permissions to view the files attached to this post.
B
16
S
3
Posts: 12
Reputation: 881