diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js index a52a1ac..f76e9de 100644 --- a/js/Demo/demoLayers.js +++ b/js/Demo/demoLayers.js @@ -559,7 +559,7 @@ addLayer("a", { const coolParticle = { image:"options_wheel.png", spread: 20, - gravity: 2, + gravity: 0, time: 9999, rotation (id) { return 20 * (id - 1.5) + (Math.random() - 0.5) * 10 @@ -568,7 +568,7 @@ const coolParticle = { return (Math.random() - 0.5) * 10 }, speed() { - return (Math.random() + 1.2) * 8 + 0 }, onClick() { console.log("yay") diff --git a/js/technical/particleSystem.js b/js/technical/particleSystem.js index 917744d..e739535 100644 --- a/js/technical/particleSystem.js +++ b/js/technical/particleSystem.js @@ -67,7 +67,7 @@ function updateParticles(diff) { function getNewParticle() { particleID++ return { - time: 3, + time: 3333, id: particleID, x: mouseX, y: mouseY, @@ -102,4 +102,15 @@ function constructParticleStyle(particle){ "pointer-events": (particle.onClick || particle.onHover) ? 'auto' : 'none', } +} + +function clearParticles(check) { + if (!check) check = true + + for (p in particles) { + console.log(run(check, particles[p], particles[p])) + if (run(check, particles[p], particles[p])){ + Vue.delete(particles, p) + } + } } \ No newline at end of file