Using sequences of images for animations

Up until now, all the animations we have created are based on changing attributes, such as the position, color value, and size, of still images. Therefore, our next enhancement is targeted towards the game objects that inhabit the game world of Canyon Bunny. We want to breathe life into the gold coin and bunny head game objects by creating several animations that are built from sequences of individual images. The resulting effect is very similar in comparison to an ordinary flip book where multiple images are perceived as a continuous animation when shown in rapid succession.

Libgdx provides a class called Animation that helps us define image sequences and also helps us to pick the right (key) frame from ...

Get Learning Libgdx Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.