• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Image Scale Problem - Possible Bug?

T

theguyuknow

Guest
First, want to say I love the updates within GMS 2. My current project has benefited immensely from the updates, and I'm excited to keep using it.

However, I believe I have run into a possible bug for the room editor or the built-in image_scale variables. Within the room editor, I set the image_yscale variable to '1.4' for a certain object.

However, I opened the debug menu and discovered the object's 'image_yscale' value was running at roughly '1.3999999'. This has oddly caused some unexpected results within my game when relying on the image_scale variables.

See the included image for visual evidence.
http://imgur.com/a/BzjEO

My question - Is this a bug within GMS 2? Or something else?

Version Details
I'm using Game Maker Studio v2.0.3.56 on a Windows 10 PC.
 
Last edited by a moderator:

Juju

Member
Might be a floating point accuracy issue. I believe internal variables are stored as single-precision rather than double-precision like other variables. Try using round() instead.
 
Last edited:
T

theguyuknow

Guest
I have found a fix by using the sprite's height value instead. However, this still seemed like odd, and probably not intentional, behavior.

I don't recall ever experiencing it with GMS 1.4. However, it is possible I just never noticed.
 
Top