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 9. Implementing Game Logic

The shortest description of this chapter contains only two words: state machines. Here, we will introduce a common approach to organize interactions between the gaming code and the user interface part of the application. We start with an implementation of the Boids algorithm and then proceed with the extension of our user interface implemented in the previous chapters.

Boids

In many game applications, you can usually see moving objects that collide, shoot, chase each other, can be touched or avoided by other objects, or produce similar behaviors. The visible complex behavior of objects can usually be broken down into a few simple states interoperating together. For example, in an arcade game an enemy randomly ...

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