O'Reilly logo

Mastering Android Game Development by Raul Portales

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

Spawning enemies – the GameController

Now we are ready to spawn some enemies. For this, we are going to introduce a new concept: the GameController.

A GameController is a special type of GameObject that has no visual representation (it is not a sprite) and its mission is to control the evolution of the game using the calls to onUpdate.

One of the most typical tasks of a GameController is managing the environment. This includes spawning enemies with the right parameters when necessary.

Game controllers fall into two main groups:

  • Procedural/random
  • Deterministic/static

Procedural/random

This is a type of GameController that generates levels or enemies based on a set of parameters (or a function) that include some sort of random input.

The main advantage ...

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