Angle problems in r244

Bugs will be moved here once resolved.

Post » Mon May 29, 2017 6:45 pm

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 .
Last edited by mehrshadfarahani on Fri Jun 02, 2017 7:47 am, edited 1 time in total.
I always thought computer games are really awful . but now i'm a game maker :|
B
13
S
4
G
1
Posts: 25
Reputation: 1,370

Post » Tue May 30, 2017 6:26 am

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.....
"That terminator is out there, it cant be bargained with, it cant be reasoned with, it doesn't feel pity or remorse or fear, and it absolutely will not stop...EVER, until you are dead!"
B
35
S
19
G
6
Posts: 224
Reputation: 6,734

Post » Tue May 30, 2017 6:39 am

NetOne wrote:
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 always thought computer games are really awful . but now i'm a game maker :|
B
13
S
4
G
1
Posts: 25
Reputation: 1,370

Post » Mon Jun 19, 2017 2:49 am

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.
B
8
S
1
Posts: 30
Reputation: 569

Post » Thu Jun 22, 2017 4:04 pm

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.
Scirra Founder
B
383
S
225
G
86
Posts: 24,134
Reputation: 190,601


Return to Closed bugs

Who is online

Users browsing this forum: mystazsea and 1 guest