Book Image

Source SDK Game Development Essentials

By : Brett Joseph Bernier
Book Image

Source SDK Game Development Essentials

By: Brett Joseph Bernier

Overview of this book

Table of Contents (18 chapters)
Source SDK Game Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Making fireworks


We can make a firework effect just as easily as fire and smoke. Let's first think about how fireworks act. They fly into the air and instantly explode into hundreds of balls of light. Gravity takes over after the initial explosion, and as the balls of light fall back to earth, they fade out. We're going to make our particle system create hundreds of particles instantly, have those particles fly out from the center, be affected by gravity, and fade out. As for the flying into the air part, we will parent the particle system to a func_physbox entity and launch it into the air.

In Particle Editor, create a new particle system called firework01.

Creating the explosion

When creating particles, it's good practice to start with an emitter like we have done with the fire effect. Unlike the fire, however, we're going to use an emit_instantaneously property to create a bunch of particles at the same time. Change the num_to_emit value to 250 to create 250 particles instantaneously.

Just...