How do I detect and apply angles.

0 favourites
  • 2 posts
  • 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.



  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)