how to constrain bodies to integer x/y coordinates
Posted: Sat Oct 08, 2011 1:10 pm
Is there an easy way to constrain a Body to whole-number coordinates? I'm making a pool game, and the balls often end up with coordinates like:
(585.61932373047, 447.06735229492)
When drawing with those coordinates, the image sprites are somewhat distorted because they are not whole numbers. I've tried rounding the body's x/y values post-update, but that is somewhat problematic because it then triggers additional collisions sometimes.
Any ideas or suggestions?
Thanks!
(585.61932373047, 447.06735229492)
When drawing with those coordinates, the image sprites are somewhat distorted because they are not whole numbers. I've tried rounding the body's x/y values post-update, but that is somewhat problematic because it then triggers additional collisions sometimes.
Any ideas or suggestions?
Thanks!