Eye candy—particle effects

Of course, even in this little game, we want some eye candy; particles in games and little graphics that appear fast, move over a small or long distance, and then disappear. They usually don't collide with anything but give the impression that they are pieces of something that got destroyed or are made of gas, smoke, water, or whatever.

One method to create particles is to create them all at once and then let them move on automatically. When you want to create particles continuously over time, you need to have emitters to do the job for you. An emitter automatically creates particles and that is what we will create now.

The particle emitter class

The emitter class to create particles will be taking care of creating new particles over a period of time. For this, we will use a constructor method and an update method.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.225