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

Chapter 5. Particle Systems

Particle systems are a technique used widely in video games to simulate phenomena that are complicated to render with other methods. The typical usages for them include explosions, fireworks, smoke, fire, water, and so on. They are usually highly chaotic systems.

Their foundation is to use a large number of small sprites called particles. Their behavior is parametrized, so each particle has a different set of pseudo-random values. This makes each usage of the particle system different while it still looks similar.

Most game engines include a way to implement particle systems. Our engine will have them too.

We will base our code on the free software project Leonids, which is a library to display particle systems in the standard Android UI. We will adapt it to be used by our engine.

After explaining the basics of particle systems, we will implement a couple of examples of one-shot particle systems to simulate explosions, and also some continuous emitters to simulate...