diff --git a/src/App.vue b/src/App.vue
index 3b44055..e4c722b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -78,7 +78,7 @@
-->
-
+
Previous Level
Next Level
+
+
+
+
+
+
+ {{ item.index }}
+
+
+ {{ item.index }}
+
+
+
+
+
+ {{ item.gamename }}
+
+
+
+ {{ item.gamename }}
+
+
+
+
+
+
+
@@ -239,53 +285,6 @@
-
-
-
-
-
-
- {{ item.index }}
-
-
- {{ item.index }}
-
-
-
-
-
- {{ item.gamename }}
-
-
-
- {{ item.gamename }}
-
-
-
-
-
-
-
-
@@ -305,19 +304,25 @@ export default {
beforeMount: function() {},
mounted: function() {
this.reset();
+ this.resetgame();
},
methods: {
copycomp: function() {
- navigator.clipboard.writeText(this.levels[this.currentLevel].compliment)
+ navigator.clipboard.writeText(this.games[this.currentgame].levels[this.currentLevel].compliment)
+ },
+ resetgame: function() {
+ for (var x = 0; x < this.games.length; x++) {
+ this.games[x].index = x;
+ }
},
reset: function () {
this.currentLevel = 0;
this.score = 0;
this.currenttask = 0;
this.name = "";
- for (var x = 0; x < this.levels.length; x++) {
- this.levels[x].completed = false;
- this.levels[x].index = x;
+ for (var x = 0; x < this.games[this.currentgame].levels.length; x++) {
+ this.games[this.currentgame].levels[x].completed = false;
+ this.games[this.currentgame].levels[x].index = x;
}
},
/*scramble: function() {
@@ -347,7 +352,7 @@ export default {
},*/
nextlevel: function () {
- if (this.currentLevel < this.levels.length) {
+ if (this.currentLevel < this.games[this.currentgame].levels.length) {
this.ready = false;
this.currenttask = 0;
this.currentLevel++;
@@ -365,10 +370,10 @@ export default {
this.currenttask++;
},*/
completetask: function () {
- if (!this.levels[this.currentLevel].completed) {
- this.levels[this.currentLevel].completed = true;
- this.score += this.levels[this.currentLevel].points;
- if (this.autonext && this.levels.length > this.currentLevel) {
+ if (!this.games[this.currentgame].levels[this.currentLevel].completed) {
+ this.games[this.currentgame].levels[this.currentLevel].completed = true;
+ this.score += this.games[this.currentgame].levels[this.currentLevel].points;
+ if (this.autonext && this.games[this.currentgame].levels.length > this.currentLevel) {
setTimeout(this.nextlevel, 600);
}
}
@@ -384,6 +389,7 @@ export default {
this.ready = false;
this.currentgame = i;
this.ready = true;
+ this.reset();
},
leveljump: function (i) {
this.ready = false;
@@ -501,7 +507,7 @@ export default {
limit: 200,
},
/*hidehighscore: false,*/
- hidehightscorecover: false,
+ hidehighscorecover: false,
fontFamily: "Acme",
games: [{
gamename: "Game1",