Hi I am developing a game using HTML5 canvas. In the game I use a lot of the coordinate x and y, but sometimes they are floating point values. I am not sure if this has positive effects to the performance of the game and the accuracy of the sprites movement in the game. Is it correct to use floating point values of x and y or do I need to convert them into integers?
I doubt it has any performance benefits or drawbacks.
However, you might encounter blurred shapes when using just integer values but it depends on what you're trying to do. See similar question: Canvas drawings, like lines, are blurry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With