O'Reilly logo

Sams Teach Yourself Android Game Programming in 24 Hours by Jonathan S. Harbour

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

Hour 8. Bringing Your Game to Life with Looping

What You’ll Learn in This Hour

• How to create a threaded game loop

• Using the Runnable interface

• Using the Thread class

• Drawing from the new game loop

This hour shows how to create a loop for a game that gives it real-time capabilities not tied in to the GUI methods (such as onDraw()) for the game’s display. To detach drawing from the GUI, you learn how to create components that can draw without being directly tied to the onDraw() event method. While exploring this new capability, you also get a glimpse at bitmap frame animation, bitmap scaling, and timing.

Creating a Threaded Game Loop

In the past few hours you have seen several examples that draw shapes and bitmaps to the Android screen. ...

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