summaryrefslogtreecommitdiffstats
path: root/pages/tutorial.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2011-11-15 00:17:46 -0800
committerPatrick Davison <snapwilliam@gmail.com>2011-11-15 00:17:46 -0800
commit147d60865d5fdbd9a867c645c6bbde4c1256a93f (patch)
tree7961a92dddbb32e057ce4e64179c720ddbbe9b97 /pages/tutorial.php
parentef017f8eae478270a925e0fc264f8a1982bad14e (diff)
downloadpathery-147d60865d5fdbd9a867c645c6bbde4c1256a93f.tar.xz
Tutorial, Map Position:'s, Solver.
Diffstat (limited to 'pages/tutorial.php')
-rw-r--r--pages/tutorial.php55
1 files changed, 44 insertions, 11 deletions
diff --git a/pages/tutorial.php b/pages/tutorial.php
index ba8d21b..d7d4b24 100644
--- a/pages/tutorial.php
+++ b/pages/tutorial.php
@@ -25,10 +25,10 @@ function challengeGo(mapid) {
case '2':
if (moves >= 18) {
flashelement('nextbtn', 15, null, 400);
- updateDsp(1, 'instructions', 'Great Job, 18 moves!<br />Lets move on to the next shall we?');
+ updateDsp(1, 'instructions', "Great, that's 18 moves!<br />Lets move on to the next shall we?");
//Unlock next button.
} else {
- updateDsp(1, 'instructions', 'As you can see, the path travels from the Start to A to Finish.<hr />Place 2 walls where it\'s flashing to make the path longer');
+ updateDsp(1, 'instructions', "The goal for this map is 18 moves.<br />Place 2 walls to make the path longer");
var tiles = ["2,3,5","2,4,6"];
markTiles(tiles);
}
@@ -37,10 +37,10 @@ function challengeGo(mapid) {
case '3':
if (moves >= 64) {
flashelement('nextbtn', 15, null, 400);
- updateDsp(1, 'instructions', 'I almost confused you! hehe.<br />Next?');
+ updateDsp(1, 'instructions', '<p>I almost confused you! hehe.</p><p>Next?</p>');
//Unlock next button.
} else {
- updateDsp(1, 'instructions', 'The path can travel over the start and end tiles too.<br />');
+ updateDsp(1, 'instructions', '<p>The path can travel over the start and end tiles too.</p><br>');
var tiles = ["3,3,6","3,4,7","3,3,2","3,2,1"];
markTiles(tiles);
}
@@ -73,6 +73,8 @@ function challengeGo(mapid) {
}
}
+
+
function markTiles(tiles) {
for(var i in tiles) {
var tmp = tiles[i];
@@ -93,15 +95,45 @@ function challengeWall(mapid) {
return;
}
}
- updateDsp(1, 'instructions', 'Excellent; those wall placements look good!<hr />Press Go and see the path it takes')
+ updateDsp(1, 'instructions', 'Excellent; those wall placements look good!<br>Press "Go!" and see the path it takes')
}
-function challengeLoad() {
+function challengeLoad() {}
+
+function challenge() {}
+challenge.prototype.unlock = function(id) {
}
+//var ch = new challenge();
+
+
+
function highlightElement(Eid) {
}
+
+function startChallenge(mapid) {
+ console.log("start challenge", mapid);
+ switch (mapid) {
+ case 1:
+ updateDsp(1, 'instructions', '<p>The point of this game is to create the longest <i>path</i> between the start and the finish.</p><p>Press Go!</p>');
+ flashelement('1,btn', 10, null, 400);
+ break;
+ case 2:
+ updateDsp(1, 'instructions', "<p>Let's start off simple;</p><p>Start by pressing 'Go!' first.</p>");
+ break;
+ case 3:
+ updateDsp(1, 'instructions', "The goal for this map is 64 moves<br />Press 'Go!'");
+ break;
+ case 4:
+ updateDsp(1, 'instructions', "Teleports are traps. See if you can use the teleport to reach 45 moves!<br />Press 'Go!'");
+ break;
+ case 5:
+ updateDsp(1, 'instructions', "Now for a difficult one. The goal for this one is 75 moves.<br />Press 'Go!' for help");
+ break;
+ }
+}
+
function TutorialView(low, high) {
this.low = low;
this.high = high;
@@ -117,6 +149,7 @@ TutorialView.prototype.showTutorial = function(num) {
}
var elem = document.getElementById("tut-" + num);
elem.className = elem.className.replace('hidden', '');
+ startChallenge(num);
}
TutorialView.prototype.next = function() {
this.showTutorial(++this.cur);
@@ -227,20 +260,20 @@ $map5 = GenerateShapedMap($challenge5, $myparams);
//Display maps.
echo '<div id="tut-1" class="hidden">';
echo DisplayMap($map1, 1, 'puzzle');
-echo '</div><div id="tut-2" class="hidden">Target: 18 moves';
+echo '</div><div id="tut-2" class="hidden">';
echo DisplayMap($map2, 2, 'puzzle');
-echo '</div><div id="tut-3" class="hidden">Target: 64 moves';
+echo '</div><div id="tut-3" class="hidden">';
echo DisplayMap($map3, 3, 'puzzle');
-echo '</div><div id="tut-4" class="hidden">Target: 45 moves';
+echo '</div><div id="tut-4" class="hidden">';
echo DisplayMap($map4, 4, 'puzzle');
-echo '</div><div id="tut-5" class="hidden">Target: 75 moves';
+echo '</div><div id="tut-5" class="hidden">';
echo DisplayMap($map5, 5, 'puzzle');
echo '</div>';
?>
<div class="wrapper">
- <a href="javascript:tv.next()" id="nextbtn" class="next">Next</a>
+ <a href="javascript:tv.next()" id="nextbtn" class="next ">Next</a>
<a href="javascript:tv.prev()" id="prevbtn" class="next hidden">Previous</a>
</div>
</div>