diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js index 140a6f5..6093844 100644 --- a/js/Demo/demoLayers.js +++ b/js/Demo/demoLayers.js @@ -527,7 +527,6 @@ addLayer("a", { }, }, midsection: ["grid", "blank"], - marked: true, grid: { maxRows: 3, rows: 2, @@ -560,7 +559,7 @@ addLayer("a", { const coolParticle = { image:"options_wheel.png", spread: 20, - gravity: 0, + gravity: 2, time: 9999, rotation (id) { return 20 * (id - 1.5) + (Math.random() - 0.5) * 10 @@ -569,7 +568,7 @@ const coolParticle = { return (Math.random() - 0.5) * 10 }, speed() { - 0 + return (Math.random() + 1.2) * 8 }, onClick() { console.log("yay") @@ -579,5 +578,6 @@ const coolParticle = { }, update() { //this.width += 1 - } + }, + layer: 'f', } \ No newline at end of file diff --git a/js/game.js b/js/game.js index 52b5d8c..03eeb15 100644 --- a/js/game.js +++ b/js/game.js @@ -335,6 +335,7 @@ function gameLoop(diff) { if (gameEnded && !player.keepGoing) { diff = 0 player.tab = "gameEnded" + clearParticles() } if (player.devSpeed) diff *= player.devSpeed diff --git a/js/utils.js b/js/utils.js index 590b767..c3e7cfc 100644 --- a/js/utils.js +++ b/js/utils.js @@ -138,6 +138,7 @@ function inChallenge(layer, id) { var onTreeTab = true function showTab(name) { 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)) { player.subtabs[name].mainTabs = Object.keys(layers[name].tabFormat)[0] } @@ -153,6 +154,7 @@ function showTab(name) { function showNavTab(name) { if (LAYERS.includes(name) && !layerunlocked(name)) return + if (player.navTab !== name) clearParticles(function(p) {return p.layer === player.navTab}) var toTreeTab = name == "tree" player.navTab = name