mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-02-02 16:41:40 +00:00
Added clearParticles function
This commit is contained in:
parent
136a120998
commit
01f33b0ebe
2 changed files with 14 additions and 3 deletions
|
@ -559,7 +559,7 @@ addLayer("a", {
|
||||||
const coolParticle = {
|
const coolParticle = {
|
||||||
image:"options_wheel.png",
|
image:"options_wheel.png",
|
||||||
spread: 20,
|
spread: 20,
|
||||||
gravity: 2,
|
gravity: 0,
|
||||||
time: 9999,
|
time: 9999,
|
||||||
rotation (id) {
|
rotation (id) {
|
||||||
return 20 * (id - 1.5) + (Math.random() - 0.5) * 10
|
return 20 * (id - 1.5) + (Math.random() - 0.5) * 10
|
||||||
|
@ -568,7 +568,7 @@ const coolParticle = {
|
||||||
return (Math.random() - 0.5) * 10
|
return (Math.random() - 0.5) * 10
|
||||||
},
|
},
|
||||||
speed() {
|
speed() {
|
||||||
return (Math.random() + 1.2) * 8
|
0
|
||||||
},
|
},
|
||||||
onClick() {
|
onClick() {
|
||||||
console.log("yay")
|
console.log("yay")
|
||||||
|
|
|
@ -67,7 +67,7 @@ function updateParticles(diff) {
|
||||||
function getNewParticle() {
|
function getNewParticle() {
|
||||||
particleID++
|
particleID++
|
||||||
return {
|
return {
|
||||||
time: 3,
|
time: 3333,
|
||||||
id: particleID,
|
id: particleID,
|
||||||
x: mouseX,
|
x: mouseX,
|
||||||
y: mouseY,
|
y: mouseY,
|
||||||
|
@ -103,3 +103,14 @@ function constructParticleStyle(particle){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue