New answers tagged


It sounds like you simply need to round the interpolated position to the nearest integer, instead of truncating it (as float → integer conversion normally does). A simple trick (for non-negative values) is simply to add 0.5 to the value before truncating it: g2d.drawImage(image, (int)(draw.x + 0.5f), (int)(draw.y + 0.5f), null); (I'm assuming that ...


Why does my position interpolation code result in "jumpy" motion? Make sure previousPosition_ is only being updated when there's a new physics update, not every frame But I still don't know if it's a good solution.

Top 50 recent answers are included