O'Reilly logo

Android Game Recipes: A Problem-Solution Approach by J. F. DiMarzio

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

Chapter     11

Moving a Character

Moving a character around the screen—whether it’s a person, animal, robot, or vehicle—is one of the more crucial parts of a compelling game. Chances are, if you have tried to create a character that moves freely in a game, you have run into some problems.

This chapter will present solutions to help you move your character around. Solutions in this chapter include making a character run, and changing the character animation when the character is moving.

The first solution helps you move your character in four directions on the screen. The remaining solutions help you move your character at different speeds and animate your character as it moves.

11.1 Move a Character in Four Directions

Problem

The character ...

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