diff --git a/index.html b/index.html
index 133d206..f3783b9 100644
--- a/index.html
+++ b/index.html
@@ -17,7 +17,7 @@
-
{{ building.name }} (Level {{ building.level }}) earning {{ building.amount.toFixed(2) }} every {{ building.intervalInSeconds.toFixed(2) }} seconds.
@@ -33,9 +33,9 @@
-
- {{ building.name }} could earn {{ building.amount }} every {{ building.intervalInSeconds }} seconds.
+ {{ building.name }} could earn {{ building.amount.toFixed(2) }} every {{ building.intervalInSeconds.toFixed(2) }} seconds.
diff --git a/js/app.js b/js/app.js
index a145588..fe04a97 100644
--- a/js/app.js
+++ b/js/app.js
@@ -99,9 +99,14 @@ let game = new Vue({
},
buyUpgrade(building) {
+ if (building.level === 'MAX') {
+ alert('Already at MAX-Level');
+ return false;
+ }
+
if (this.money >= building.price) {
this.sub(building.price);
- this.upgradeBuilding(building)
+ this.upgradeBuilding(building);
} else {
alert('Not enough money');
}
@@ -110,11 +115,16 @@ let game = new Vue({
upgradeBuilding(building, first = false) {
this.killIntervals();
- building.level++;
- building.price *= 1.25;
+ if (building.level < 15) {
+ building.level++;
+ } else {
+ building.level = 'MAX';
+ }
+
+ building.price = Number(building.price * 1.25).toFixed(2);
if (first === false) {
- building.intervalInSeconds *= 0.95;
+ building.intervalInSeconds = Number(building.intervalInSeconds * 0.95).toFixed(2);
}
this.reloadBuildings();