diff --git a/docs/particles.md b/docs/particles.md index b64eeae..60d41d8 100644 --- a/docs/particles.md +++ b/docs/particles.md @@ -23,8 +23,8 @@ Features can be functions or constant. These features will be called when each p All distances are in pixels and angles are in degrees, with 0 being up and going clockwise. - time: The amount of time, in seconds, that the particle will last. Default is 3. -- fadeTime: The amount of seconds that fading out at the end should take (part of the total lifetime). Default is 1. -- fadeTime: The amount of seconds that fading in should take (part of the total lifetime). Default is 0. +- fadeOutTime: The amount of seconds that fading out at the end should take (part of the total lifetime). Default is 1. +- fadeInTime: The amount of seconds that fading in should take (part of the total lifetime). Default is 0. - image: The image the particle should display. `""` will display no image. Default is a generic particle. - text: Displays text on the particle. Can use basic HTML. diff --git a/js/technical/particleSystem.js b/js/technical/particleSystem.js index fc0dcae..678fd62 100644 --- a/js/technical/particleSystem.js +++ b/js/technical/particleSystem.js @@ -82,7 +82,7 @@ function getNewParticle() { yVel: 0, rotation: 0, gravity: 0, - fadeTime: 1, + fadeOutTime: 1, fadeInTimer: 0, fadeIn: 0, } @@ -94,8 +94,8 @@ function updateMouse(event) { } function getOpacity(particle) { - if ((particle.time < particle.fadeTime) && particle.fadeTime) - return particle.time / particle.fadeTime + if ((particle.time < particle.fadeOutTime) && particle.fadeOutTime) + return particle.time / particle.fadeOutTime if (particle.fadeInTimer > 0) return 1 - (particle.fadeInTimer / particle.fadeInTime)