Angle problems in r244

0 favourites
  • 5 posts
  • Problem Description

    ____ C2 has a problem with angles except 0 . for example set your sprite angle to 180 , it will set something more than 180 and we have some problems with events . ____

    Attach a Capx

    ____ https://drive.google.com/open?id=0B1yUi ... XdYVnpsQUk ____

    Description of Capx

    ____ A sprite with angle 180 and a textbox to show the angle. ____

    Steps to Reproduce Bug

    • Create a sprite and set angle to 180.
    • Create a textbox .
    • Make an event to set textbox.text to sprite.angle

    Observed Result

    ____ Textbox show the angle more than 180 and sprite didn't destroy. ____

    Expected Result

    ____ Textbox should show 180 and the sprite must be destroyed . ____

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (NO)

    Operating System and Service Pack

    ____ Win 7 Ultimate 64-bit service pack 1 ____

    Construct 2 Version ID

    ____ R244 ____

    NOTE : It doesn't have any problem if you set the angle using event .

  • The manual does recommend not using "is equal to" for angles instead use "is within"

    Interestingly if you set the sprite angle to -180 it will be read as exactly 180

    Probably something with how angles are calculated in C2 and in computers in general.

    Interesting tho.....

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Interestingly if you set the sprite angle to -180 it will be read as exactly 180

    I check it . nothing changed , it still has problem !

  • I tested the bug in r243 and it acts exactly as you said. It appears an internal issue, but you can do an aprox validation.

  • Closing as not a bug. Internally C2 stores angles as radians, so it converts degrees to radians. However, CPUs are not perfectly accurate at math. See "Expecting math calculations to be exact" in this blog. It's normal to get results that are close to, but not exactly, the answer you want, hence the need to accept a small range.

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