ok now I know this is how you're supposed to do it, but how could you ever predict what delta would be
when lowering changeX I would have to know
Also, I just tried it
using * delta
and using setsmoothupdate(true) and * delta
both times I print out the delta each frame to see it.
without smoothupdate they range from 15 to sometimes 35
with it, it seems stead at 16
and here is the kicker: it doesn't matter, both stil jitter
1 2 3 4 5 6 7 8 9 10 11
| float xChange = 0.4f; float yChange = 0.5f; ... gc.setSmoothDeltas(true); ... public void update(GameContainer gc, int delta) throws SlickException { xPos+=xChange * delta; yPos+=yChange * delta; if (xPos <= 0 || xPos >= gc.getWidth()) xChange = -xChange; if (yPos <= 0 || yPos >= gc.getHeight()) yChange = -yChange; } |
still jitters D=
And whats strange is that, i wanted to make a small new game, and got this behavior. However my main game doesn't have that problem.
My main game also
only uses the render and not the update, because I knew of the delta, but I ported my whole game from Java2D, and obviously changing all the values in the game to fit delta would be outrageous.
And my game works fine. Even if I copy this ball bouncing code into my game, it doesn't jitter.
I think its because there is so much going on and in this empty example not, so that fps changes are greater here.