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

Venture around the map

We can now move on the heart of the game itself, moving our hero around the map. This section will address concepts that are pretty common in game development, such as:

  • Sprites
  • Game loops
  • Scrolling
  • Positioning
  • Speed calculation

No directional pad, but that's okay

Anybody who has ever held a typical smartphone will have surely noticed that there is nothing that can act as a controller; there's no trackball and there are no directional buttons. That's not a problem; we'll just build our own.

To do this, we will use an image that will act as a controller for our game. A Virtual Directional Control Pad (V-Pad), similar to the following diagram, will allow us to move our hero in every direction:

Creating our V-Pad

The V-Pad creation

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