Chapter 19. Listening with the Observer Pattern, Multitouch and Building a Particle System

In this chapter we will get to code and use our first design pattern. The Observer pattern is exactly what it sounds like. We will code some classes that will indeed observe another class. We will use this pattern to allow the GameEngine class to inform other classes when they need to handle user input. This way individual classes can handle different aspects of user input.

In addition, we will code a particle system. A particle system comprises of hundreds or even thousands of graphical objects that are used to create an effect. Our particle system will look like an explosion.

Here is a summary of this chapter:

  • The Observer pattern
  • Upgrading the player's controls ...

Get Learning Java by Building Android Games - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.