Book Image

Mastering Android Game Development

By : Raul Portales
Book Image

Mastering Android Game Development

By: Raul Portales

Overview of this book

Table of Contents (18 chapters)
Mastering Android Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
API Levels for Android Versions
Index

General concepts


We are going to make our particle system in a way that mimics the Leonids particle system library at http://plattysoft.github.io/Leonids/. This project is a free software library I made to use particle systems in the standard Android UI.

A demo of the Leonids library is available on Google Play

As a result of this, Leonids implements its own update and draw threads, as well as a simplified GameView. We already have all these, so we will adapt the code to suit our needs.

The concepts we are going to work with in this chapter are:

  • Particle: Each of the sprites that are rendered

  • Particle system: The entity that takes care of spawning, updating, and keeping track of the particles

  • Initializer: A class that sets a value for a particle based on certain parameters (before being active)

  • Modifier: A class that updates a value for a particle based on the elapsed time (while being active)

In our game, we will use only a few initializers and modifiers. If you need to extend the functionality...