• 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!

Problem with fractual numbers

Le Don

Member
Hi, guys, I have a problem. I'm making a game similar to Into the Breach and at some fields, my characters coordinates have fractual numbers, which is causing some trouble. I try using round() to get rid of the fractual parts, but that doesn't seem to work. Here are some screenshots to help my explain this better:

In screenshot 1 the x value of one of the player characters has a fractual value.
error_01.PNG

I use round() in screenshot 2 to get rid of that, which seems to work.
error_02.PNG

Screenshot 3 shows the last time the x value is rounded.
error_03.PNG

After that step event, which takes place in a different object and doesn't deal with the player coordinates at all, we get to the draw events and the value is fractured again.
error_04.PNG

Does anyone know a proper way to deal with that? I hope I could explain it properly, but please let me know, if you have questions.
 

Le Don

Member
Alright, I could solve this problem by using round() for the player coordinates at my battle controller, which is the first object, that is initialized and also the first one in the step event. But I'm not happy with that solution and still open for suggestions.
 
Top