mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-28 02:51:55 +00:00
Clear particles with an associated layer when leaving that layer
This commit is contained in:
parent
4f831f51b0
commit
96cecedec5
3 changed files with 7 additions and 4 deletions
|
@ -527,7 +527,6 @@ addLayer("a", {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
midsection: ["grid", "blank"],
|
midsection: ["grid", "blank"],
|
||||||
marked: true,
|
|
||||||
grid: {
|
grid: {
|
||||||
maxRows: 3,
|
maxRows: 3,
|
||||||
rows: 2,
|
rows: 2,
|
||||||
|
@ -560,7 +559,7 @@ addLayer("a", {
|
||||||
const coolParticle = {
|
const coolParticle = {
|
||||||
image:"options_wheel.png",
|
image:"options_wheel.png",
|
||||||
spread: 20,
|
spread: 20,
|
||||||
gravity: 0,
|
gravity: 2,
|
||||||
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
|
||||||
|
@ -569,7 +568,7 @@ const coolParticle = {
|
||||||
return (Math.random() - 0.5) * 10
|
return (Math.random() - 0.5) * 10
|
||||||
},
|
},
|
||||||
speed() {
|
speed() {
|
||||||
0
|
return (Math.random() + 1.2) * 8
|
||||||
},
|
},
|
||||||
onClick() {
|
onClick() {
|
||||||
console.log("yay")
|
console.log("yay")
|
||||||
|
@ -579,5 +578,6 @@ const coolParticle = {
|
||||||
},
|
},
|
||||||
update() {
|
update() {
|
||||||
//this.width += 1
|
//this.width += 1
|
||||||
}
|
},
|
||||||
|
layer: 'f',
|
||||||
}
|
}
|
|
@ -335,6 +335,7 @@ function gameLoop(diff) {
|
||||||
if (gameEnded && !player.keepGoing) {
|
if (gameEnded && !player.keepGoing) {
|
||||||
diff = 0
|
diff = 0
|
||||||
player.tab = "gameEnded"
|
player.tab = "gameEnded"
|
||||||
|
clearParticles()
|
||||||
}
|
}
|
||||||
if (player.devSpeed) diff *= player.devSpeed
|
if (player.devSpeed) diff *= player.devSpeed
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,7 @@ function inChallenge(layer, id) {
|
||||||
var onTreeTab = true
|
var onTreeTab = true
|
||||||
function showTab(name) {
|
function showTab(name) {
|
||||||
if (LAYERS.includes(name) && !layerunlocked(name)) return
|
if (LAYERS.includes(name) && !layerunlocked(name)) return
|
||||||
|
if (player.tab !== name) clearParticles(function(p) {return p.layer === player.tab})
|
||||||
if (player.tab === name && isPlainObject(tmp[name].tabFormat)) {
|
if (player.tab === name && isPlainObject(tmp[name].tabFormat)) {
|
||||||
player.subtabs[name].mainTabs = Object.keys(layers[name].tabFormat)[0]
|
player.subtabs[name].mainTabs = Object.keys(layers[name].tabFormat)[0]
|
||||||
}
|
}
|
||||||
|
@ -153,6 +154,7 @@ function showTab(name) {
|
||||||
|
|
||||||
function showNavTab(name) {
|
function showNavTab(name) {
|
||||||
if (LAYERS.includes(name) && !layerunlocked(name)) return
|
if (LAYERS.includes(name) && !layerunlocked(name)) return
|
||||||
|
if (player.navTab !== name) clearParticles(function(p) {return p.layer === player.navTab})
|
||||||
|
|
||||||
var toTreeTab = name == "tree"
|
var toTreeTab = name == "tree"
|
||||||
player.navTab = name
|
player.navTab = name
|
||||||
|
|
Loading…
Reference in a new issue