Book Image

Learning LibGDX Game Development- Second Edition

Book Image

Learning LibGDX Game Development- Second Edition

Overview of this book

Table of Contents (21 chapters)
Learning LibGDX Game Development Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Animating the menu screen


Let's now discuss what we are actually going to animate in the menu screen. Basically, the first two bits of our animated menu involve the gold coins and the large bunny head.

Take a look at the following screenshot:



In this screenshot, you can see a rough sketch of the final animation divided into four essential steps. The following actions need to be taken for the shown steps:

  1. The gold coins and bunny head are invisible at the beginning.

  2. The gold coins fade in and scale up from 0 percent to 100 percent from the center screen as if they were jumping out of the water.

  3. After a short pause, the bunny head appears in the top-right corner, which moves slightly until it reaches the edge of the rock that is visible in the background.

  4. The bunny head moves as if it was jumping over to the other rock in front of it.

Animating the gold coins and bunny head actors

Add the following (static) import lines to the MenuScreen class:

import static com.badlogic.gdx.scenes.scene2d.actions...