summaryrefslogtreecommitdiffstats
path: root/pages/tutorial.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/tutorial.php')
-rw-r--r--pages/tutorial.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/pages/tutorial.php b/pages/tutorial.php
index 36d6721..5e582c6 100644
--- a/pages/tutorial.php
+++ b/pages/tutorial.php
@@ -19,13 +19,11 @@ function challengeGo(mapid) {
switch (mapid) {
case '1':
tv.unlock();
- flashelement('nextbtn', 15, null, 400);
updateDsp(1, 'instructions', "Now that you see what's going on, let's move on to some puzzles.");
break;
case '2':
if (moves >= 18) {
- flashelement('nextbtn', 15, null, 400);
updateDsp(1, 'instructions', "Great, that's 18 moves!<br />Lets move on to the next shall we?");
tv.unlock();
} else {
@@ -37,7 +35,6 @@ function challengeGo(mapid) {
case '3':
if (moves >= 64) {
- flashelement('nextbtn', 15, null, 400);
updateDsp(1, 'instructions', '<p>I almost confused you! hehe.</p><p>Next?</p>');
tv.unlock();
} else {
@@ -49,7 +46,6 @@ function challengeGo(mapid) {
case '4':
if (moves >= 45) {
- flashelement('nextbtn', 15, null, 400);
updateDsp(1, 'instructions', "Figure out how that teleport worked?<br />Play with it if you didn't");
tv.unlock();
} else {
@@ -61,7 +57,6 @@ function challengeGo(mapid) {
case '5':
if (moves >= 75) {
- flashelement('nextbtn', 15, null, 400);
updateDsp(1, 'instructions', 'Look at you so pro.<br />Go play the game!');
//Unlock next button.
} else {
@@ -141,6 +136,7 @@ function TutorialView(low, high) {
this.cur = low;
this.nextbtn = document.getElementById('nextbtn');
this.prevbtn = document.getElementById('prevbtn');
+ this.interval1 = this.interval2 = null;
}
TutorialView.prototype.showTutorial = function(num) {
for (var i = this.low; i <= this.high; i++) {
@@ -153,6 +149,8 @@ TutorialView.prototype.showTutorial = function(num) {
startChallenge(num);
}
TutorialView.prototype.next = function() {
+ clearInterval(this.interval1);
+ clearInterval(this.interval2);
if (this.nextbtn.className.indexOf(' disabled') > -1)
return;
this.showTutorial(++this.cur);
@@ -176,6 +174,14 @@ TutorialView.prototype.prev = function() {
}
TutorialView.prototype.unlock = function(n) {
this.nextbtn.className = this.nextbtn.className.replace('disabled', '');
+ this.interval1 = setInterval(function() {
+ tv.nextbtn.className += ' flash';
+ }, 1200);
+ setTimeout(function() {
+ this.interval2 = setInterval(function() {
+ tv.nextbtn.className = tv.nextbtn.className.replace('flash', '');
+ }, 1200);
+ }, 600);
}
</script>