mac-comp127 / kilt-graphics

Graphics and UI library for learning software development principles in Java
https://mac-comp127.github.io/kilt-graphics/
2 stars 17 forks source link

Smoother animation #13

Closed pcantrell closed 3 years ago

pcantrell commented 3 years ago

Ditching Swing’s timer in favor of a custom timer class that delivers a stabler, smoother frame rate.

Adds a second variant of canvas.animate() that accepts a callback with a dt parameter, so that animations can compensate for actual frame rate to create smoother apparent motion. (This was really noticeable with Critters on a large screen!)