Particle systems
Now that our flags are in place and we've learned how to manage the resources we'll need to decorate our world, let's add some additional visual effects. The first type of effect we'll look at is particle systems.
Particles are planes that always face the camera, usually grouped together into a system to create some effect like fire or steam. They are essential for creating great visuals like this colorful heart:
Capturing the flag
We'd like to set off a celebratory fireworks-style display when the player captures a flag, so if you haven't already done so, go ahead and add the mechanics of capturing flags. The core logic should be in a function we'll call for each player in our physics loop:
function checkHasFlag(unit) { var otherFlag = unit.team === TEAMS.R ? TEAMS.B.flag : TEAMS.R.flag; if (unit.hasFlag) { var flag = unit.team === TEAMS.R ? TEAMS.R.flag : TEAMS.B.flag; if (flag.mesh.visible...