diff --git a/index.html b/index.html
index 0ef7999..b2d7423 100644
--- a/index.html
+++ b/index.html
@@ -15,12 +15,14 @@
+
+
diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js
index cadab01..b9381bf 100644
--- a/js/Demo/demoLayers.js
+++ b/js/Demo/demoLayers.js
@@ -300,7 +300,7 @@ addLayer("c", {
["main-display",
"prestige-button", "resource-display",
["blank", "5px"], // Height
- ["raw-html", function() {return "
"}],
+ ["raw-html", function() {return "
"}],
["display-text", "Name your points!"],
["text-input", "thingy"],
["display-text",
@@ -555,3 +555,5 @@ addLayer("a", {
},
},
)
+
+const coolParticle = {}
\ No newline at end of file
diff --git a/js/components.js b/js/components.js
index 20984ca..1698da8 100644
--- a/js/components.js
+++ b/js/components.js
@@ -544,6 +544,7 @@ function loadVue() {
Vue.component('info-tab', systemComponents['info-tab'])
Vue.component('options-tab', systemComponents['options-tab'])
Vue.component('tooltip', systemComponents['tooltip'])
+ Vue.component('particle', systemComponents['particle'])
app = new Vue({
@@ -582,6 +583,9 @@ function loadVue() {
LAYERS,
hotkeys,
activePopups,
+ particles,
+ mouseX,
+ mouseY,
},
})
}
diff --git a/js/game.js b/js/game.js
index ec0a9fb..397d033 100644
--- a/js/game.js
+++ b/js/game.js
@@ -406,6 +406,7 @@ var interval = setInterval(function() {
ticking = true
let now = Date.now()
let diff = (now - player.time) / 1e3
+ let trueDiff = diff
if (player.offTime !== undefined) {
if (player.offTime.remain > modInfo.offlineLimit * 3600) player.offTime.remain = modInfo.offlineLimit * 3600
if (player.offTime.remain > 0) {
@@ -427,7 +428,8 @@ var interval = setInterval(function() {
updateTabFormats()
gameLoop(diff)
fixNaNs()
- adjustPopupTime(0.05)
+ adjustPopupTime(trueDiff)
+ updateParticles(trueDiff)
ticking = false
}, 50)
diff --git a/js/technical/particleSystem.js b/js/technical/particleSystem.js
new file mode 100644
index 0000000..e580606
--- /dev/null
+++ b/js/technical/particleSystem.js
@@ -0,0 +1,46 @@
+// Variables that must be defined to display popups
+var particles = [];
+var particleID = 0;
+var mouseX = 0;
+var mouseY = 0;
+
+// Function to show popups
+function makeParticles(data, amount=1) {
+ for (let x = 0; x < amount; x++) {
+ let particle = getNewParticle()
+ for (thing in data) {
+ switch(thing) {
+ case DEFAULT:
+ particle[thing]=data[thing]
+
+ }
+ }
+ particles.push(particle)
+ }
+}
+
+
+//Function to reduce time on active popups
+function updateParticles(diff) {
+ for (p in particles) {
+ particles[p].time -= diff;
+ if (particles[p]["time"] < 0) {
+ particles.splice(p, 1); // Remove popup when time hits 0
+ }
+ }
+}
+
+function getNewParticle() {
+ particleID++
+ return {
+ time: 5,
+ id: particleID,
+ x: mouseX,
+ y: mouseY,
+ }
+}
+
+function updateMouse(event) {
+ mouseX = event.clientX
+ mouseY = event.clientY
+}
\ No newline at end of file
diff --git a/js/technical/systemComponents.js b/js/technical/systemComponents.js
index e19dffd..2ee930b 100644
--- a/js/technical/systemComponents.js
+++ b/js/technical/systemComponents.js
@@ -187,7 +187,14 @@ var systemComponents = {