O'Reilly logo

Learning Libgdx Game Development by Andreas Oehlke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating the game screen

We are now going to animate the gold coin and bunny head game objects. However, before we can start building new animations, some preparations need to take place first, such as adding the actual image files to the project and rebuilding the texture atlas afterwards.

Copy the following files to CanyonBunny-desktop/assets-raw/images/:

  • anim_bunny_normal_XX.png (where XX is 01, 02, 03)
  • anim_bunny_copter_XX.png (where XX is 01, 02, 03, 04, 05)
  • anim_gold_coin_XX.png (where XX is 01, 02, 03, 04, 05, 06)

Now, set the rebuildAtlas variable to true and run the Canyon Bunny desktop application once to let the texture atlas be rebuilt with the newly added images for our animations.

Defining and preparing new animations

The following image ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required