My thought was that in my class, the playerX and playerY would keep it's "true" float value ... But it looks wrong for some reason.
Depending on your algorithm, using
might be better - will have the effect of rounding.
This was what I was thinking about when deciding whether to round the playerX itself or to typecast it.
If you hold down "left" for lets say 1minute. You are gona lose a small amount(0.1-0.9) every time you updade. And in the long run it will be a pretty big difference. Wouldn't it?
Both Java2D and OpenGL can use interpolation to give the appearance of sub-pixel accuracy through interpolation. As the Java2D drawImage calls only take ints, you have to use the form that takes an AffineTransform, and also make sure that interpolation is set to bilinear or bicubic. Of course, you didn't want this to work quickly, right?
I am using interpolation. But I think im using it wrong because I didnt understand anything of that
I use it when updating, for example, movement.
playerX += 3.0f*interpolation;