O'Reilly logo

LibGDX Cross-Platform Development Blueprints by Indraneel Potnis

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

Character animation

In this section, we will learn how to animate our character Bob.

Walking Bob 1

You might have noticed that when we move Bob, he does not appear to be walking. He just slides on the screen. To create a realistic walking effect, we need to animate our character. Animation is just a sequence of images shown one after the other at regular intervals. This creates an illusion of a continuous motion.

Alright, so let's get started. First, we will need the sequence of images. We will use a single image that consists of all these images. This is called a sprite sheet. I have already acquired the sprite sheet for our character, which looks similar to this:

The image contains the different walk stages of Bob. Each stage or each image of Bob ...

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