O'Reilly logo

Mastering Android NDK by Viktor Latypov, Sergey Kosarevsky

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 10. Writing Asteroids Game

We will continue putting together the material from previous chapters. We will implement an Asteroids game with 3D graphics, shadows, particles, and sounds using techniques and code fragments introduced in the previous chapters. First, we will extend the previous material with a few more ideas, and then, we will move on and code a complete gaming application. Let's start with an onscreen joystick.

Creating an on-screen joystick

An on-screen joystick is based on multi-touch handling. Two structures contain descriptions of a single joystick button and an axis. The button is given an index and is specified by its color in the FColour field of the sBitmapButton structure. When a user taps the screen where the underlying ...

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