This tutorial assumes you have completed Parts 1-3, since it will build off of the same epilogue. For this tutorial, we'll be adding some particle effects.

Particle effects are sprites that are controlled via a physics engine rather than key frame animation..

Fog Effect

To add some mystique to the scene, we'll be adding some smoke particles.
  1. Open up your ending to the Blue scene.
  2. Make sure the "Oh no!" action is selected.
  3. Add an emitter using the button next to the "Add Speech Bubble" button. Emitters are invisible objects that create particles.
  4. Set the ID to "smoke machine".
  5. Emitters have no graphical representation in the game, but in the editor are represented by a circle with an arrow pointing in the direction of the emitter.
  6. Drag the emitter to somewhere around Florina's foot level, around (X: 1250, Y: 1350).
  7. With the cursor on the outside of one of the emitter's corners so that a curved arrow appears, drag to rotate the emitter. Rotate it to point left. Alternatively, manually set the rotation to -90.
  8. We need to assign a sprite to the emitter. Click ... in the Source field and choose ep_fog.png from Florina's folder.
  9. As long as the emitter is selected, you'll see it emit particles. Every second, a fog sprite appears and fades away.
  10. The fog is sideways because the emitter is rotated sideways. Check "Ignore rotation" in the Property Table. Now the fog is facing the right direction.
  11. We want the fog to move across the scene.
  12. Emitters have dozens of properties compared to other directives. Find Speed and set the fields to 200 and 250, meaning each particle will move between 200-250 pixels per second.
  13. The fog begins moving left but fades away too quickly.
  14. Set Particle Life (s): 15.00
  15. Set Start Scale X: 2.00 to 3.00. When both fields are provided, every fog particle will use a random scale between 2 and 3.
  16. The fog just looks like one long line, so let's add some variance to the direction it moves. Set Angle to 5, meaning each particle will be spit out between -5 and 5 degress from the direction the emitter is facing.
  17. It's still too thick, so set Start Alpha: 50 to 60.
  18. This is looking pretty decent now, so let's do it again on the other side. Select the "smoke machine" object in the timeline and press Ctrl+D to duplicate it.
  19. Name the duplicate "smoke machine 2".
  20. Change the following properties, keeping the old values in all others. If these are not available, click the initial keyframe for "smoke machine 2."
    • X: -1680
    • Rotation: 90
  21. Play through the scene and admire the foggy ground. So mysterious!
  22. The editor is really not a fan of big, translucent images, so this may really bog down the preview. It should be much smoother in game.

Sparks

Particles don't need images. We'll add a spark effect to the orb explosion to demonstrate another use for particles.
  1. Use the Add Emitter button to add another emitter.
  2. Name the emitter's ID: "sparks".
  3. Drag this emitter to the middle of the orb, (X: -240, Y: 1280).
  4. Set Width and Height to 10.
  5. Set Speed: 800 to 900
  6. Go down to the Start Color and End Color properties and fill them out with yellow and orange colors so that the particles take a random color between yellow and orange. The particles will start flying into the sky.
  7. Bump the Rate up to 5.00 so we can see the randomness more easily.
  8. Set Particle Life (s): 1.5 to 2.
  9. Set Force Y: 1000. This adds a gravity effect to the sparks.
  10. Set Angle: 90.
  11. These settings give a good enough effect for particles flying out of the orb in random directions and falling to the ground, but we don't want to emit particles constantly.
  12. Set the Rate to 0 to stop creating particles completely.
As you may have seen already, using lots of particle effects can be very taxing on performance, so use them sparingly.

Burst Particles

As mentioned in the previous section, we don't want an endless stream of sparks, so we'll use a burst emission.
  1. Make sure "sparks" is selected in the timeline.
  2. Move the time marker to 0:00s.
  3. Click the "Add Particle Emission" button next to the "Add Emitter" button.
  4. A rectangle appears in the timeline. You can drag this around to change where the burst occurs.
  5. Click on the rectangle to open it in the Property Table.
  6. Set Count: to 100 to generate 100 particles at once.
  7. Preview the animation to see this effect. You should see a semi-circle of sparks flying out of the orb.
  8. This isn't exactly realistic, so let's lower the number and add more bursts.
  9. Set Count: to 20.
  10. Copy the "Emit Particle" directive. (Ctrl+C while selected).
  11. Move the time marker to 0.06s and paste (Ctrl+V).
  12. Move the time marker to 0.12s and paste (Ctrl+V).
  13. You should now have 3 bursts.
  14. Play through the scene. Good enough!

Animating Emitters

Emitters can be animated just like sprites. We'll use this knowledge to make a trail of sparks behind the orb as it rolls.
  1. Click the sparks emitter directive in the scene view and copy it (Ctrl+C).
  2. Click the Camera directive in the scene view and paste (Ctrl+V) to insert the new emitter directly after the camera animation directive.
  3. Click the "Oh no!" action in the Action list to go back to the action where the orb rolls into place.
  4. Click in the timeline and paste (Ctrl+V) to paste a new "sparks" emitter.
  5. Name this emitter "trail".
  6. We don't need the burst effects anymore, so click each rectangle and delete them (Delete button)
  7. Drag the emitter object in the timeline so it starts at 0.5s (same as where the orb starts).
  8. Move the emitter behind the orb's starting point (X: -1450, Y: 1375).
  9. Set the following properties, clearing out all others (use the eraser button next to the field).
    • Rotation: -33
    • Rate: 100
    • Angle: 5
    • Speed: 300 to 500
    • Force Y: 500
    • Start Color: Use current, duplicated values
    • End Color: Use current, duplicated values
    • Start Alpha: 100
    • End Alpha: 0
  10. Drag the time marker to 1.5s.
  11. Move the emitter to X: -80.
  12. We don't want to keep creating a trail after it stops moving, so toggle the emitter to have a fixed length.

Final Review

That's it. You've completed an epilogue that covers all the basics: scenes, transitions, camera movement, animations, fades, and particle effects. Try it out in the game one more time to verify everything looks good.

There are several parameters for particles that were not covered in this tutorial. Go ahead and play around with the various parameters while previewing the animation to get a taste of what they control.