O'Reilly logo

Creating Mobile Apps with Appcelerator Titanium by Christian Brousseau

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

Our hero moves, but he's still pretty stiff

One thing you may have noticed while moving our hero around the map is that no matter where our hero goes, he always faces the same direction (downwards). While this behavior was widely accepted in the 1980s, the same cannot be said for today's games, even for mobile games. We will now address this in the following section.

Make sure he walks in the right direction

As the title says, there are two new things our hero must be able to do. The first one is walking, which will involve animation. The second one is facing the right direction, which will involve using more features of our sprite sheet.

Since our Character class contains everything related to our hero, we will open the character.js file and add ...

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