O'Reilly logo

Beginning Android Tablet Games Programming by Jeremy Kerfs

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

Creating the User Controls

The constructor method of GameView.java has several newcomers. This section dissects the new sprites that are used primarily for user interaction and also shows you a new concept. Rather than create four different cannon icons that point in all of the cardinal directions, you rotate one image for the four different sprites. This saves space on your machine, but it also causes some extra processor work at startup.

To demonstrate the alternative, the main cannons are all individual sprites that don’t need to be rotated. The method you use on such occasions depends on your resources and how much space you have on disk.

Follow these steps:

1. Before you can start working with the new sprites, you must first declare the ...

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