Game Development Reference
In-Depth Information
With those changes in place, our fireworks look quite decent. Now it's your turn to play with the code and
make them even better looking. You could, for example, add more colors or shapes to make the fireworks
more varied.
Fire
Another classic particle effect is fire. In this section, we will implement a big, hot fire using a lot of particles
(see Figure 6-4). So let's get started.
Figure 6-4. Fire demo in action
Creating the textures
Our fire will be created out of four different fire textures, plus one little spark that's just a scaled-down
version of the spark we used to create the fireworks. As you can see in Figure 6-5, the flame textures are
basically just flame-like shapes that have been blurred and colored. The first one is a bit sharper and has a
more intense color; this is necessary to give the flame some edges. The second and the last one also
have some noise added to provide some more detail. All of the textures are 32 × 32 pixels except for the
last one, which is 64 × 64 in order to cover a bigger area. When colorizing the textures, it is again very
important that no channel ends up at zero—or it will look wrong.
 
Search WWH ::




Custom Search