2d - How do I make character movement smooth in Java? -
i creating 2d rpg game in java , wondering how character movement can made smooth , not pixel pixel.
i have animation thread runs every 20 mills , thats when draws everything.
the simplest way of doing this, if you're saying movement calculated x = x + dx make x have higher resolution x axis of display.
if x axis 640 pixels, make x have range 0 -> 5120 (640*8) example . when rendering downscale fit screen (add 4 , bit shift).
that way can simulate having character move sub-pixel amounts per frame, results in smoother movement.
Comments
Post a Comment