Explosion effects
While it is possible to assemble a frame-animated explosion effect and overlay it onto the screen whenever an explosion takes place, there are drawbacks to this approach.
The explosion will, by its nature as an animated sprite, be limited to a few frames which play sequentially. All of the explosions in the game will look exactly alike. We could certainly create a handful of explosion sequences and play a random sequence when an explosion was called for, but we would quickly be using more textures for explosions than anything else in the game.
Expanding on sprites – particles
Instead of a fixed explosion texture, we will design a simple particle system that we will use to generate explosions in Asteroid Belt Assault. This approach will allow us to have dynamically varying explosions that will not look identical to each other. In order to do so, we will create a Particle class that will be a child of the Sprite class, expanding on its functionality to include acceleration,...