diff options
-rw-r--r-- | pages/tutorial.php | 158 |
1 files changed, 65 insertions, 93 deletions
diff --git a/pages/tutorial.php b/pages/tutorial.php index 3a12d32..f40845f 100644 --- a/pages/tutorial.php +++ b/pages/tutorial.php @@ -5,17 +5,10 @@ htmlHeader(array('tutorial')); <?php
topbar($Links);
-
-
-
-
?>
<script type="text/javascript" src="sounds/script/soundmanager.js"></script>
-<?
-$requiredmoves = '18';
-?>
<script type="text/javascript">
isChallenge = true;
@@ -28,64 +21,69 @@ function challengeGo(mapid) { switch (mapid) {
case '1':
- if (moves == <? echo $requiredmoves; ?>) {
flashelement('nextbtn', 15, null, 400);
- updateDsp(1, 'instructions', 'Great Job!<br />Lets move on to the next shall we?')
+ 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 Job, 18 moves!<br />Lets move on to the next shall we?')
//Unlock next button.
} else {
- //challengehint();
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')
- //flashelement('1,instructions', 2, '#cce', 700);
- //setTimeout('document.getElementById("1,3,5").style.backgroundColor = "#ccccdd"', 500);
- //setTimeout('document.getElementById("1,4,6").style.backgroundColor = "#ccccdd"', 600);
- tiles=["1,3,5","1,4,6"];
- marktiles(tiles);
+ tiles=["2,3,5","2,4,6"];
+ markTiles(tiles);
}
break;
- case '2':
- if (moves == 20) {
+ case '3':
+ if (moves == 64) {
flashelement('nextbtn', 15, null, 400);
updateDsp(1, 'instructions', 'I almost confused you! hehe.<br />Next?')
//Unlock next button.
} else {
- //challengehint();
updateDsp(1, 'instructions', 'The path can travel over the start and end tiles too.<br />')
- //flashelement('1,instructions', 2, '#cce', 700);
- //setTimeout('document.getElementById("1,3,5").style.backgroundColor = "#ccccdd"', 500);
- //setTimeout('document.getElementById("1,4,6").style.backgroundColor = "#ccccdd"', 600);
- tiles=["2,2,4","2,3,3","2,4,2","2,4,1"];
- marktiles(tiles);
+ tiles=["3,3,6","3,4,7","3,3,2","3,2,1"];
+ markTiles(tiles);
}
break;
- case '3':
- if (moves == 20) {
+ case '4':
+ if (moves == 45) {
flashelement('nextbtn', 15, null, 400);
- updateDsp(1, 'instructions', 'I almost confused you! hehe.<br />Next?')
+ updateDsp(1, 'instructions', "Figure out how that teleport worked?<br />Play with it if you didn't")
//Unlock next button.
} else {
- //challengehint();
- updateDsp(1, 'instructions', 'The path can travel over the start and end tiles too.<br />')
- //flashelement('1,instructions', 2, '#cce', 700);
- //setTimeout('document.getElementById("1,3,5").style.backgroundColor = "#ccccdd"', 500);
- //setTimeout('document.getElementById("1,4,6").style.backgroundColor = "#ccccdd"', 600);
- tiles=["3,3,6","3,4,7","3,3,2","3,2,1"];
- marktiles(tiles);
+ updateDsp(1, 'instructions', "Let's use that teleport to block the way to the A!<br />We can also make it take longer to get to A in the process.")
+ tiles=["4,1,5","4,2,6","4,3,7","4,5,9"];
+ markTiles(tiles);
+ }
+ break;
+
+ 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 {
+ updateDsp(1, 'instructions', 'Now it gets more difficult.<br />')
+ tiles=["5,1,5","5,2,6","5,3,3","5,4,2","5,3,1"];
+ markTiles(tiles);
}
break;
}
-
}
-function marktiles(tiles) {
+function markTiles(tiles) {
for(var i in tiles) {
tmp = tiles[i];
setTimeout('document.getElementById("'+tiles[i]+'").style.backgroundColor = "#ccccdd"', i*150 + 900);
}
}
+//!!
function challengeWall(mapid) {
//Required walls:
var reqwall = new Array();
@@ -112,24 +110,11 @@ function highlightElement(Eid) { }
-function challengehint() {
- //setTimeout("flashelement('1,3,5', 10, '#cce', 620);", 100);
- //setTimeout("flashelement('1,4,6', 10, '#cce', 620);", 100);
- setTimeout("flashelement('1,btn', 6, '#ee4', 620);", 1500);
- setTimeout("flashelement('1,instructions', 3, '#cce', 620);", 700);
- //updateDsp(mapid, element, data) {
-}
-
-
-
-
</script>
<?php
include('./includes/maps.php');
-
-include('./includes/datas.php');
-
+//include('./includes/datas.php');
//Page Load;
//STAGE 1:
@@ -163,43 +148,26 @@ The point of this game is to create the longest <i>path</i> between the start an <?
echo "<a href='#'>Previous</a> | <a href='#' id='nextbtn'>Next</a> ";
-
-
-$example1[] = "sraooroooof";
-$example1[] = "sorooroorof";
-$example1[] = "sooroooroof";
-$example1[] = "sooorrrooof";
-$example1[] = "sooooooooof";
-
+//Prepare maps.
+$example1[] = "sraoorooof";
+$example1[] = "sorooroorf";
+$example1[] = "soorooorof";
+$example1[] = "sooorrroof";
+$example1[] = "soooooooof";
$myparams['teleports'] = 0;
$myparams['walls'] = 0;
+$map1 = GenerateShapedMap($example1, $myparams);
-$examplemap = GenerateShapedMap($example1, $myparams);
-
-
-$challenge1[] = "sooraooof";
-$challenge1[] = "sooorooof";
-$challenge1[] = "sooooooof";
-$challenge1[] = "sooooooof";
-$challenge1[] = "sooooooof";
-
-$myparams['checkpoints'] = 1;
-$myparams['teleports'] = 0;
-$myparams['walls'] = 2;
-
-$map1 = GenerateShapedMap($challenge1, $myparams);
-
-$challenge2[] = "soooaroof";
+$challenge2[] = "sooraooof";
+$challenge2[] = "sooorooof";
$challenge2[] = "sooooooof";
$challenge2[] = "sooooooof";
$challenge2[] = "sooooooof";
-$challenge2[] = "sooooooof";
-$myparams['checkpoints'] = 2;
+$myparams['checkpoints'] = 1;
$myparams['teleports'] = 0;
-$myparams['walls'] = 4;
+$myparams['walls'] = 2;
$map2 = GenerateShapedMap($challenge2, $myparams);
-
$challenge3[] = "soooraoof";
$challenge3[] = "sooooroof";
$challenge3[] = "sooooooof";
@@ -213,36 +181,40 @@ $map3 = GenerateShapedMap($challenge3, $myparams); $challenge4[] = "suooooatoof";
$challenge4[] = "sooooooooof";
$challenge4[] = "sooooooooof";
-$challenge4[] = "sooooooooof";
+$challenge4[] = "sooooooorof";
$challenge4[] = "sooooooooof";
$challenge4[] = "sooooooooof";
$myparams['checkpoints'] = 1;
$myparams['teleports'] = 1;
-$myparams['walls'] = 5;
+$myparams['walls'] = 4;
$map4 = GenerateShapedMap($challenge4, $myparams);
+$challenge5[] = "soooaobtorf";
+$challenge5[] = "soocrooooof";
+$challenge5[] = "souooooooof";
+$challenge5[] = "sooooooooof";
+$challenge5[] = "sooooooooof";
+$myparams['checkpoints'] = 3;
+$myparams['teleports'] = 1;
+$myparams['walls'] = 5;
+$map5 = GenerateShapedMap($challenge5, $myparams);
-echo DisplayMap($examplemap, 0, 'puzzle');
-echo "<br />";
+
+//Display maps.
+echo "<br />Target: 35 moves.";
echo DisplayMap($map1, 1, 'puzzle');
-echo "<br />";
+echo "<br />Target: 18 moves.";
echo DisplayMap($map2, 2, 'puzzle');
-echo "<br />";
+echo "<br />Target: 64 moves.";
echo DisplayMap($map3, 3, 'puzzle');
-echo "<br />";
+echo "<br />Target: 45 moves.";
echo DisplayMap($map4, 4, 'puzzle');
+echo "<br />Target: 75 moves.";
+echo DisplayMap($map5, 5, 'puzzle');
echo "<br />";
-//echo "<br /><center>map2</center>";
-echo "<br />";
-//echo DisplayMap($map2, 2);
-//$mysolution = getSolution($userID, $mapID);
-//$solutiondiv .= "<div id='mapsol' style='visibility:hidden;display:none'>";
-//$solutiondiv .= "<div id='mapsol'>";
-//$solutiondiv .= $mapID.":".$mysolution;
-//$solutiondiv .= '</div>';
+echo "<br />";
-//echo $solutiondiv;
?>
</div>
<script type="text/javascript">soundManagerInit();</script>
|