Repository navigation
Example Effects
Here are a few pre-made effects I made using the particle system. These are meant to be examples of how some effects are made and serve as inspiration or a basis for other effects you might make. I encourage you to play round with different properties of each effect, change the generator shape, change the color or scale animation, change the expansion, or anything property, and see what happens!
const fire = new ParticleSystem(0,100,600);
fire.generator.name = "FirePS";
fire.generator.shape = "Direction";
fire.generator.scale = [0,0,0];
fire.generator.position = [0.6,0,5];
fire.generator.expansion = [3,0,0];
fire.particle.life = 4;
fire.particle.distance = 6;
fire.particle.animate.color = [[1,1,1,1,0],[1,1,0,1,0.25],[1,0.5,0,1,0.5],[1,0,0,1,1]];
fire.particle.animate.dissolve = [[1, 0.1], [1, 0.7], [0, 1]];
fire.push(x => {
x.animate.localRotation = [[rand(0,180),rand(0,180),rand(0,180),0],[rand(0,180),rand(0,180),rand(0,180),1]]
});Placeholder text.
How I made this fireflies effect is by starting off by making a "Field" particle system, this makes all particles in a specific region to spawn and despawn, which is what we want for this effect. So I set the scale of the generator to a large area for the particles to spawn in, and then center the generator far in front of the player. The lifespan of each particle will have to be relatively short, so I set each particle's lifespan to 4. After each particle will spawn, they will move 1 unit in an direction, along with a dissolve animation to fade the particles in, a color animation to animate the brightness of the fireflies, and set the scale of each particle to be small.
const fireflies = new ParticleSystem(0,100,1000);
fireflies.generator.name = "FirefliesPS";
fireflies.generator.shape = "Field";
fireflies.generator.scale = [100,10,100];
fireflies.generator.position = [0.6,0,50];
fireflies.particle.life = 4;
fireflies.particle.distance = 1;
fireflies.particle.animate.dissolve = [[0,0],[1, 0.25], [1, 0.75], [0, 1]];
fireflies.particle.animate.color = [[0,0,0,0,0],[10,10,0,10,0.5],[0,0,0,0,1]]
fireflies.particle.animate.scale = [0.1,0.1,0.1]
fireflies.push();Placeholder text.
const stars = new ParticleSystem(0,0.02,400); // Creates a particle system at the time 0 and produces particles for 0.02 beats
stars.generator.name = "StarsPS"; // Gives the name "StarsPS" to the parent track of all particles
stars.generator.shape = "Sphere"; // Changes the generator shape to "Sphere"
stars.generator.expansion = 7500; // The starting position of the particles will be 7500 units from the center of the sphere
stars.particle.distance = 7500; // The particles end 7500 units from the middle of the sphere
stars.particle.life = 1000; // The particles will last for 1000 beats.
stars.particle.animate.scale = [7.5,7.5,7.5]; // The scale of each particle will be [7.5,7.5,7.5]
stars.particle.animate.color = [100,100,100,100]; // The scale of each particle will be [100,100,100,100]
stars.push(); // Make the particle systemconst explosion = new ParticleSystem(2,0.02,250);
explosion.generator.name = "ExplosionPS";
explosion.generator.shape = "Sphere";
explosion.particle.distance = 10;
explosion.particle.life = 1;
explosion.particle.easing = "easeOutExpo";
explosion.particle.animate.scale = [0.1,0.1,0.1];
explosion.particle.animate.color = [[1,1,1,10,0],[0,0,10,10,0.2]];
explosion.particle.animate.dissolve = [[1,0],[1,0.6],[0,0.8]];
explosion.generator.position = [0,0,20]
explosion.push();