B
bdonohue
Guest
Hey folks!
So I've been using Shaun Spalding's GameMaker Studio 2: Complete Platformer Tutorial
and I've been noticing that my player's y coordinates ALWAYS have decimal values (eg; 320.22). The x values are always whole numbers.
Anybody have any idea why this would happen? All of my platforms are locked to the grid, so all of them are located at whole number pixel locations. I also noticed that whenever I land on a platform (from jumping or falling) the numbers to the right of the decimal are always different... almost random. Sometimes it's 320.22, sometimes it's 320.32, sometimes 320.42, etc...
So I have a number of questions running through my head now... Could this cause problems? Why does it happen? Is this just some weird nuance of the Game Maker 2 engine, or would it be caused by Shaun's code? Is there some easy way to force my y values to be whole numbers? Does it even matter?
The only thing I can think of is that it is related to the gravity used in his code, since it only affects the y values.
Thanks in advance
So I've been using Shaun Spalding's GameMaker Studio 2: Complete Platformer Tutorial
and I've been noticing that my player's y coordinates ALWAYS have decimal values (eg; 320.22). The x values are always whole numbers.
Anybody have any idea why this would happen? All of my platforms are locked to the grid, so all of them are located at whole number pixel locations. I also noticed that whenever I land on a platform (from jumping or falling) the numbers to the right of the decimal are always different... almost random. Sometimes it's 320.22, sometimes it's 320.32, sometimes 320.42, etc...
So I have a number of questions running through my head now... Could this cause problems? Why does it happen? Is this just some weird nuance of the Game Maker 2 engine, or would it be caused by Shaun's code? Is there some easy way to force my y values to be whole numbers? Does it even matter?
The only thing I can think of is that it is related to the gravity used in his code, since it only affects the y values.
Thanks in advance
Last edited by a moderator: