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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -