Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning LibGDX Game Development- Second Edition
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning LibGDX Game Development- Second Edition

Learning LibGDX Game Development- Second Edition

By : Suryakumar B Nair, Andreas Oehlke
3.5 (11)
close
close
Learning LibGDX Game Development- Second Edition

Learning LibGDX Game Development- Second Edition

3.5 (11)
By: Suryakumar B Nair, Andreas Oehlke

Overview of this book

This book is aimed at indie and existing game developers as well as those who want to get started with game development using LibGDX. Basic knowledge of Java programming and game development is required.
Table of Contents (16 chapters)
close
close
15
Index

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, and 03)
  • anim_bunny_copter_XX.png (where XX is 01, 02, 03, 04, and 05)
  • anim_gold_coin_XX.png (where XX is 01, 02, 03, 04, 05, and 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 screenshot depicts all the frames, including their indices of the gold coin animation:

Defining and preparing new animations

The shown frames are meant to be played back in a ping-pong loop (play mode: LOOP_PINGPONG) for the final animation. We will later refer to it as animGoldCoin...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY