Graphics "jitter"?
Posted: Mon Jul 22, 2013 11:32 pm
I am having an issue where the objects I draw seem to "jitter" (I don't know of a better way to describe it) as the screen scrolls. I have a feeling this is due to the way the draw functions handle float coordinates, but haven't been able to figure it out.
I generate a static field of stars based on world coordinates and then a set of dynamic stars that scroll past as the ship moves. I have this part working, as well as ship movement. The problem occurs when the camera moves with the ship and scrolls the screen...the stars themselves do not scroll smoothly and seem to snap around; same with the ship. I tried math.floor to try and keep everything integers but it didn't seem to help.
Anyway, I've attached my .love so you can hopefully see what I'm trying to describe. Use WASD to control the ship (it can fly out of bounds; I haven't got to that yet). Everything is in main.lua; you can ignore the console stuff as I'm just using it to help with debugging.
I appreciate any help that may be offered; thanks!
I generate a static field of stars based on world coordinates and then a set of dynamic stars that scroll past as the ship moves. I have this part working, as well as ship movement. The problem occurs when the camera moves with the ship and scrolls the screen...the stars themselves do not scroll smoothly and seem to snap around; same with the ship. I tried math.floor to try and keep everything integers but it didn't seem to help.
Anyway, I've attached my .love so you can hopefully see what I'm trying to describe. Use WASD to control the ship (it can fly out of bounds; I haven't got to that yet). Everything is in main.lua; you can ignore the console stuff as I'm just using it to help with debugging.
I appreciate any help that may be offered; thanks!