Adding an explosion to our game

In Chapter 7, Adding Boundaries and Using Sprites to Create Explosions, we have already created our ExplosionEffect.java class file. Now, we are left with just one task: to spawn our explosion on the screen. Now, just for reference, we will take a look at the image we will use for our explosion file:

Explosion.png file sprite sheet

Note that the last frame of our explosion has almost no image in it. This is because we are not going to destroy this object; we are simply going to spawn it and let it play its animation for now.

Let's proceed and get our explosion running on our game screen. Again, here we will ...

Get Learning Android Game Development 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.