summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pages/achievements.php366
-rw-r--r--pages/challenge.php361
2 files changed, 727 insertions, 0 deletions
diff --git a/pages/achievements.php b/pages/achievements.php
new file mode 100644
index 0000000..edcb893
--- /dev/null
+++ b/pages/achievements.php
@@ -0,0 +1,366 @@
+<?php
+htmlHeader(array('profile'), 'Pathery Achievements');
+?>
+
+<body>
+
+<?php
+topbar($Links);
+
+include_once('./includes/db.inc.php');
+include_once('./includes/datas.php');
+
+//Get UserID
+if (is_int($_GET['id'] * 1) AND isset($_GET['id']))
+ $userID = $_GET['id'] * 1;
+else
+ if (isset($_SESSION['userID']))
+ $userID = $_SESSION['userID'];
+ else
+ $userID = 3;
+
+$viewer = true;
+if ($userID == $_SESSION['userID'])
+ $viewer = false;
+
+?>
+<script>
+var viewer = <?
+if ($viewer)
+ echo "true;";
+else
+ echo "false;";
+?>
+
+function colorclick(obj, color, unlockID) {
+ if (viewer)
+ return;
+ var hbadge = document.getElementById('badge');
+ hbadge.style.backgroundColor = color;
+ document.getElementById('selectColor').value = color;
+ document.getElementById('selectColorID').value = unlockID;
+}
+
+function emblemclick(obj, emblem, unlockID) {
+ if (viewer)
+ return;
+ var hbadge = document.getElementById('badge');
+ hbadge.style.backgroundImage="url(images/marks/"+emblem+")";
+ document.getElementById('selectEmblem').value = emblem;
+ document.getElementById('selectEmblemID').value = unlockID;
+}
+
+function namecolorclick(obj, color, unlockID) {
+ if (viewer)
+ return;
+ var bheader = document.getElementById('badgeheader');
+ bheader.style.color=color;
+ document.getElementById('selectNameColor').value = color;
+ document.getElementById('selectNameColorID').value = unlockID;
+}
+</script>
+
+<?
+
+$sql = "
+SELECT
+ id,
+ type,
+ name,
+ value,
+ dateUnlocked
+FROM `unlocks`
+WHERE userID = '$userID'
+";
+$result = mysql_query($sql);
+if ($result) {
+ while ($row = mysql_fetch_assoc($result))
+ $unlocks[$row['type']][$row['id']] = $row;
+}
+
+
+//print_R($_POST);
+
+//Validate selection and then update.
+if (isset($_POST['doupdate']) AND !$viewer) {
+ //print_R($unlocks);
+ $unlockIDC = $_POST['selectColorID'];
+ $unlockColor = $unlocks[1][$unlockIDC]['value'];
+
+ $unlockIDE = $_POST['selectEmblemID'];
+ $unlockEmblem = $unlocks[2][$unlockIDE]['value'];
+
+ $unlockIDNC = $_POST['selectNameColorID'];
+ $unlockNameColor = $unlocks[3][$unlockIDNC]['value'];
+
+ if ($unlockIDC == 0)
+ $unlockColor = '#666666';
+ if ($unlockIDE == 0)
+ $unlockEmblem = 'blank.png';
+ if ($unlockIDNC == 0)
+ $unlockNameColor = '#cccccc';
+
+ if ($unlockColor == $_POST['selectColor']) {
+ $sql = "UPDATE `userData`
+ SET `wallColor` = '$unlockColor'
+ WHERE `userID` = '$userID'";
+ $result = mysql_query($sql);
+ if (!$result)
+ echo "Error updating wall color";
+ }
+ if ($unlockEmblem == $_POST['selectEmblem']) {
+ $sql = "UPDATE `userData`
+ SET `wallEmblem` = '$unlockEmblem'
+ WHERE `userID` = '$userID'";
+ $result = mysql_query($sql);
+ if (!$result)
+ echo "Error updating Emblem";
+ }
+ if ($unlockNameColor == $_POST['selectNameColor']) {
+ $sql = "UPDATE `userData`
+ SET `displayColor` = '$unlockNameColor'
+ WHERE `userID` = '$userID'";
+ $result = mysql_query($sql);
+ if (!$result)
+ echo "Error updating Username Display Color";
+ }
+
+}
+
+
+$sql = "
+SELECT
+ type,
+ MAX(level) as level,
+ dateCompleted
+FROM `achievements`
+WHERE userID = '$userID'
+GROUP BY `type`";
+$result = mysql_query($sql);
+if ($result) {
+ while ($row = mysql_fetch_assoc($result))
+ $achievements[$row['type']] = $row;
+}
+
+$sql = "
+SELECT
+ users.displayName,
+ users.isAdmin,
+ SUM(solutions.moves) as totalMoves,
+ COUNT(*) as totalSolutions,
+ IfNull(userData.wallColor, '#666666'),
+ IfNull(userData.displayColor, '#cccccc'),
+ userData.wallEmblem
+FROM `users`
+JOIN `solutions`
+ ON users.ID = solutions.userID
+LEFT JOIN `userData`
+ ON users.ID = userData.userID
+WHERE users.ID = '$userID'
+GROUP BY solutions.userID
+";
+$result = mysql_query($sql);
+if (!$result OR mysql_num_rows($result) <= 0) {
+
+ echo "<div class='wrapper'><h1>Achievements Page</h1>
+ No selection.
+ </div>";
+ htmlFooter();
+ exit;
+}
+list($UDisplay, $UAdmin, $UTotalMoves, $UTotalSolutions, $wallColor, $nameColor, $wallEmblem) = mysql_fetch_row($result);
+
+$DUTotalMoves = number_format($UTotalMoves);
+$UTotalSolutions = number_format($UTotalSolutions);
+
+$uStats[1] = $UTotalMoves;
+$uStats[2] = $UTotalSolutions;
+
+echo "<div class='wrapper'>";
+if ($viewer)
+ echo "<center><h3>Viewing</h3></center>";
+echo "
+<h1 id='badgeheader' style='margin-left:10px;color:$nameColor;'>
+<div id='badge' style='margin-right:10px; background:$wallColor url(../images/marks/$wallEmblem);float:left;background-size:100%;' class='badge'>
+ <div style='width:100%; height:100%; background-color:transparent; background-size:100%;' class='grid_td_rocks grid_inner'></div>
+</div>
+$UDisplay</h1>";
+
+
+//Type 1; wall unlocks:
+if (isset($unlocks[1])) {
+ echo "<h2>Unlocks</h2>";
+ echo "<h3>Wall colors unlocked:</h3>
+ <table><tr>";
+ //Default color:
+ echo "<td id='color_0' title='Default Charcoal' onClick='colorclick(this,\"#666666\", \"0\")' style='background-color:#666666;' class='grid_td_walls'></td>";
+ foreach ($unlocks[1] as $item) {
+ echo "<td id='color_$item[id]' title='$item[name]' onClick='colorclick(this,\"$item[value]\", \"$item[id]\")' style='background-color:$item[value];' class='grid_td_walls'></td>";
+ }
+ echo "</tr></table>";
+ echo "<div id='color_data' style='visibility:hidden;display:none'>";
+ $item[id];
+ echo "</div>";
+}
+//Type 2; emblem unlocks:
+if (isset($unlocks[2])) {
+ echo "<h3>Emblems unlocked:</h3>
+ <table><tr>";
+ //Default Emblem
+ echo "<td class='grid_td_walls' title='Default Blank' onClick='emblemclick(this,\"blank.png\", \"0\")' style='background: #999 url(../images/marks/blank.png);' >
+ <div class='grid_inner grid_td_walls'></div></td>";
+ foreach ($unlocks[2] as $item) {
+ echo "<td class='grid_td_walls' title='$item[name]' id='' onClick='emblemclick(this,\"$item[value]\", \"$item[id]\")' style='background: #999 url(../images/marks/$item[value]);' >
+ <div class='grid_inner grid_td_walls'></div></td>";
+ }
+ echo "</tr></table>";
+}
+
+//Type 3; display-name color unlocks.
+if (isset($unlocks[3])) {
+ echo "<h3>Username colors unlocked:</h3>";
+ echo "<div class='name_color_select'>";
+
+ echo "<span onClick='namecolorclick(this,\"#cccccc\", \"0\");' style='color:#cccccc; margin-right:15px;'>";
+ echo "Default";
+ echo "</span>";
+
+ foreach ($unlocks[3] as $item) {
+ echo "<span onClick='namecolorclick(this,\"$item[value]\", \"$item[id]\")' style='color:$item[value]; margin-right:15px;'>";
+ echo "&nbsp;$item[name]&nbsp;";
+ echo "</span>";
+ }
+
+ echo "</div>";
+ echo "<br />";
+}
+
+if (!$viewer) {
+ echo "
+ <form action='achievements' method='post' name='updateBadge'>
+ <input id='doupdate' type='hidden' name='doupdate' value='true' />
+ <input id='selectColor' type='hidden' name='selectColor' value='$wallColor' />
+ <input id='selectColorID' type='hidden' name='selectColorID' value='' />
+ <input id='selectEmblem' type='hidden' name='selectEmblem' value='$wallEmblem' />
+ <input id='selectEmblemID' type='hidden' name='selectEmblemID' value='' />
+ <input id='selectNameColor' type='hidden' name='selectNameColor' value='$nameColor' />
+ <input id='selectNameColorID' type='hidden' name='selectNameColorID' value='' />
+ <input type='submit' value='Save Changes' />
+ </form>
+ ";
+}
+
+
+echo "<hr />";
+
+
+
+echo "<h2>Achievements</h2>";
+
+foreach($achievements as $aType => $a) {
+ $CPD = getAchievementsArray($aType);
+
+ $aLevel = $a['level'];
+ $aCompleted = $a['dateCompleted'];
+ $uCurrent = $uStats[$aType];
+
+ $aTypeNames[1] = "Path Career Level $aLevel!";
+ $aTypeNames[2] = "Mazes Career Level $aLevel!";
+ $aTypeNames[32] = 'Tutorial Complete!';
+
+ $name = $aTypeNames[$aType];
+ echo "<h3>$name</h3>";
+ if ($aType >= 32) {
+ echo "Completed on $aCompleted";
+ break;
+ }
+
+
+ foreach ($CPD as $item) {
+ list($required, $unlockType, $unlockValue, $unlockName) = $item;
+ $nRequired = number_format($required);
+ }
+ echo "Last level achieved on $aCompleted";
+ echo "<br />Currently you have $uCurrent ";
+ echo "<br />Next level at $nRequired will unlock:<table><tr>";
+ echo displayUnlock($unlockType, $unlockValue, $unlockName);
+}
+
+
+//Type 1; Career Path:
+if (isset($achievements[1]) AND 1 == 2) {
+ $CPD = getCareerPathArray();
+
+ $level = $achievements[1]['level'];
+ echo "<h3>Path Career level $level!</h3>
+ $UTotalMoves total moves.
+ ";
+
+ $i = 0;
+ //echo "<br />Unlocked:<table><tr>";
+ foreach ($CPD as $item) {
+ list($required, $unlockType, $unlockValue, $unlockName) = $item;
+
+ $nRequired = number_format($required);
+ if ($item['req'] > $UTotalMoves) {
+ break;
+ }
+ //echo "<td title='Level $i: Req $nRequired'><div style='background-color:$color;' class='grid_td_walls'></div></td>";
+ $i++;
+ }
+ //echo "</tr></table>";
+ echo "<br />Next level at $nRequired will unlock:<table><tr>";
+ echo displayUnlock($unlockType, $unlockValue, $unlockName);
+
+ //echo "<td title='Level $i: Req $nRequired'><div style='background-color:$color;' class='grid_td_rocks'></div></td>";
+ //echo "</tr></table>";
+} else {
+ //echo "Never played.";
+}
+
+if (false) {
+echo "<h3>Mazes Career: $UTotalSolutions</h3>
+You have played $UTotalSolutions mazes.
+
+Wall embelms unlocked:
+<table><tr>
+<td style='background-color:#fff;' class='grid_td_rocks'>
+ <div class='grid_td' style='background:url(../images/TeleportInW.png);'></div>
+</td>
+
+";
+}
+
+
+function displayUnlock($uType, $uValue, $uName) {
+ switch ($uType) {
+ case 1:
+ $r .= "$uName Wall Color!";
+ $r .= "<table><tr><td onclick='changeWallColor(\"$uValue\")' style='background-color:$uValue;' class='grid_td_rocks'></td></tr></table>";
+ break;
+ case 2:
+ $r .= "$uName Emblem!";
+ $r .= "<div class='grid_td_rocks' title='' onClick='emblemclick(this,\"$uValue\", \"0\")' style='background: #999 url(../images/marks/$uValue);' >";
+ $r .= "<div class='grid_inner grid_td_walls'></div></div>";
+ break;
+ case 3:
+ $r .= "<br /><span style='color:$uValue;font-weight:bold;font-size:120%;background-color:#222;'>$uName Username color!</span>";
+ break;
+ }
+ return $r;
+}
+
+
+
+
+
+?>
+
+</div>
+
+<?php
+echo "<br /><br />";
+echo "<br /><br />";
+echo "<br /><br />";
+htmlFooter();
+?> \ No newline at end of file
diff --git a/pages/challenge.php b/pages/challenge.php
new file mode 100644
index 0000000..f011d3e
--- /dev/null
+++ b/pages/challenge.php
@@ -0,0 +1,361 @@
+<?php
+htmlHeader(array('tutorial'));
+?>
+
+<body>
+
+<?php
+topbar($Links);
+?>
+
+<script src="sounds/script/soundmanager.js"></script>
+
+<script>
+isChallenge = true;
+
+
+function challengeLoad() {}
+
+
+challenge1 = new Object();
+challenge2 = new Object();
+challenge3 = new Object();
+challenge4 = new Object();
+challenge5 = new Object();
+
+
+challenge1.start = "Welcome to Advanced Training #1. Help for these puzzles will be limited.<br /><i>Goal: 32</i> or more.";
+challenge1.help = "If that was wrong, then try the right.<br /><i>Goal: 32</i> or more.";
+challenge1.complete = "Great, I hope we discovered some things about the pathing.<br/>Press <b>Next</b>";
+
+challenge2.start = "Round 2! What does it do when there's 2 outs?<br><i>Goal: 22</i> or more.";
+challenge2.complete = "Yup, you can just block things off when there's more than one. This holds true for checkpoints too.<br/>Press <b>Next</b>";
+challenge2.help = "This might be something you didn't know you could do<br /><i>Goal: 22</i> or more.";
+
+challenge3.start = "Round 3! We're really getting to know that clock-wise path-priority thing aren't we.<br><i>Goal: 39</i> or more.";
+//challenge3.complete = "What did you decide to do with that 4th wall? <br/>Press <b>Next</b>";
+challenge3.complete = "I wonder what you decided to do with that 4th wall... That's it for now. Go play the game! (press home)";
+challenge3.bonus = "Bonus Level unlocked. 'cMeInDtDeLrE'<br/>Press <b>Next</b>";
+challenge3.help = "I believe in this case, less is more.<br><i>Goal: 39</i> or more.";
+
+challenge4.start = "Teleports are traps you can use to your advantage. See if you can use the teleport to reach 33 moves!<br>Press <b>Go!</b>";
+challenge4.complete = "Well done!<br>Teleports add extra intrigue to the game.";
+challenge4.help = "Let's use that teleport to block the way to the <i>A</i>!<br>We can make the path take longer to get to <i>A</i> in the process.";
+
+challenge5.start = "Now for a difficult one. The goal for this one is 75 moves.<br>Press <b>Go!</b> to check your path.";
+challenge5.complete = "Look at you, so pro.<br><a href='home'>Go play the game!</a>";
+challenge5.help = "Try placing the walls as highlighted.";
+
+function challengeGo(mapid) {
+ var moves = mapjson[mapid].moves;
+
+ switch (mapid) {
+ case '1':
+ if (moves >= 32) {
+ updateDsp(1, 'instructions', challenge1.complete);
+ tv.unlock(2);
+ } else {
+ updateDsp(1, 'instructions', challenge1.help);
+ }
+ break;
+
+ case '2':
+ if (moves >= 22) {
+ updateDsp(1, 'instructions', challenge2.complete);
+ tv.unlock(3);
+ } else {
+ updateDsp(1, 'instructions', challenge2.help);
+ //var tiles = ["2,3,5","2,4,6"];
+ //markTiles(tiles);
+ }
+ break;
+
+ case '3':
+ if (moves >=39) {
+ updateDsp(1, 'instructions', challenge3.complete);
+ tv.unlock(4);
+ } else {
+ updateDsp(1, 'instructions', challenge3.help);
+ }
+ break;
+
+ case '4':
+ if (moves >= 33) {
+ updateDsp(1, 'instructions', challenge4.complete);
+ tv.unlock(5);
+ } else {
+ updateDsp(1, 'instructions', challenge4.help);
+ var tiles = ["4,1,5","4,2,6","4,3,7","4,4,9"];
+ markTiles(tiles);
+ }
+ break;
+
+ case '5':
+ if (moves >= 75) {
+ updateDsp(1, 'instructions', challenge5.complete);
+ //Unlock next button.
+ } else {
+ updateDsp(1, 'instructions', challenge5.help);
+ var tiles = ["5,1,5","5,2,6","5,3,3","5,4,2","5,3,1"];
+ markTiles(tiles);
+ }
+ break;
+
+ }
+}
+
+
+
+function markTiles(tiles) {
+ for(var i in tiles) {
+ var tmp = tiles[i];
+ setTimeout('document.getElementById("'+tiles[i]+'").style.backgroundColor = "#ccccdd"', i*150 + 900);
+ }
+}
+
+//!!
+function challengeWall(mapid) {
+ //Disable function
+ return;
+ //Required walls:
+ var reqwall = new Array();
+ reqwall[0] = "3,5.";
+ reqwall[1] = "4,6.";
+
+ for(var i in reqwall) {
+ if (solution[mapid].indexOf(reqwall[i]) == -1) {
+ //Failed
+ return;
+ }
+ }
+ updateDsp(1, 'instructions', challenge2.wallstext)
+}
+function highlightElement(Eid) {
+}
+
+
+function startChallenge(mapid) {
+ //console.log("start challenge", mapid);
+ switch (mapid) {
+ case 1:
+ updateDsp(1, 'instructions', challenge1.start);
+ var goBtn = document.getElementById('1,btn');
+ var interval1 = setInterval(function() {
+ goBtn.className += ' flash';
+ }, 1200),
+ interval2;
+ setTimeout(function() {
+ interval2 = setInterval(function() {
+ goBtn.className = goBtn.className.replace(' flash', '');
+ }, 1200);
+ }, 600);
+ var prevHandler = goBtn.onclick;
+ goBtn.onclick = function() {
+ clearInterval(interval1);
+ clearInterval(interval2);
+ goBtn.className = goBtn.className.replace(' flash', '');
+ prevHandler.apply(this, arguments);
+ }
+ break;
+ case 2:
+ updateDsp(1, 'instructions', challenge2.start);
+ break;
+ case 3:
+ updateDsp(1, 'instructions', challenge3.start);
+ break;
+ case 4:
+ updateDsp(1, 'instructions', challenge4.start);
+ break;
+ case 5:
+ updateDsp(1, 'instructions', challenge5.start);
+ break;
+ }
+}
+
+function TutorialView(low, high) {
+ this.low = low;
+ this.high = high;
+ this.cur = low;
+ //Lock them all.
+ this.locked = low;
+
+ //Override hack to unlock all the levels.
+ //this.locked = high;
+
+ 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++) {
+ var elem = document.getElementById("tut-" + i);
+ if (elem.className.indexOf('hidden') < 0)
+ elem.className += 'hidden';
+ }
+ var elem = document.getElementById("tut-" + num);
+ elem.className = elem.className.replace('hidden', '');
+ //Is the map after this disabled?
+ this.nextbtn.className = this.nextbtn.className.replace(' disabled', '');
+ if (this.locked <= this.cur)
+ this.nextbtn.className += ' disabled';
+ startChallenge(num);
+ tv.nextbtn.className = tv.nextbtn.className.replace(' flash', '');
+}
+TutorialView.prototype.next = function() {
+ clearInterval(this.interval1);
+ clearInterval(this.interval2);
+ if (this.nextbtn.className.indexOf(' disabled') > -1)
+ return;
+ this.showTutorial(++this.cur);
+ if (this.cur == this.high) {
+ if (this.nextbtn.className.indexOf('hidden') < 0)
+ this.nextbtn.className += ' hidden';
+ } else {
+ this.nextbtn.className = this.nextbtn.className.replace(' hidden', '');
+ //this.nextbtn.className += ' disabled';
+ }
+ this.prevbtn.className = this.prevbtn.className.replace(' hidden', '');
+}
+TutorialView.prototype.prev = function() {
+ this.showTutorial(--this.cur);
+ if (this.cur == this.low) {
+ if (this.prevbtn.className.indexOf('hidden') < 0)
+ this.prevbtn.className += ' hidden';
+ } else
+ this.prevbtn.className = this.prevbtn.className.replace(' hidden', '');
+ this.nextbtn.className = this.nextbtn.className.replace(' hidden', '');
+}
+TutorialView.prototype.unlock = function(n) {
+ if (n > this.locked) {
+ this.locked = n;
+ if (this.locked >= this.cur) {
+ this.nextbtn.className = this.nextbtn.className.replace(' disabled', '');
+ this.interval1 = setInterval(function() {
+ tv.nextbtn.className += ' flash';
+ }, 1200);
+ setTimeout(function() {
+ tv.interval2 = setInterval(function() {
+ tv.nextbtn.className = tv.nextbtn.className.replace(' flash', '');
+ }, 1200);
+ }, 600);
+ }
+ }
+
+
+}
+</script>
+
+<?php
+include('./includes/maps.php');
+//include('./includes/datas.php');
+
+//Page Load;
+//STAGE 1:
+//Intro and Instructions; press go!
+//Lightup; Go-button.
+
+//Go is done animating and GOAL is unachieved.
+//STAGE 2:
+//Show where walls go, and/or encourage them.
+//Lightup; Wall Spots
+
+//All walls have been placed correctly.
+//STAGE 3:
+//'That looks good, try pressing Go!'
+//Lightup; Go-Button
+
+//Go is done animating, and goal is achieved:
+//STAGE 4:
+//Horray! Move on to next - highlight 'Next'
+//Lightup; Next-Button
+
+?>
+<div id="tut-wrapper">
+ <div style='height:80px;' id='1,instructions'>
+ Welcome to Advanced Training #1. Help for these puzzles will be limited.<br /><i>Goal: 32</i> or more.
+ </div>
+<?
+
+//Prepare maps.
+$example1[] = "ootooooooooo";
+$example1[] = "oofooooooooo";
+$example1[] = "oooooooooooo";
+$example1[] = "oooooooooooo";
+$example1[] = "oooooooousoo";
+
+$myparams['teleports'] = 1;
+$myparams['walls'] = 5;
+$map1 = GenerateShapedMap($example1, $myparams);
+
+$challenge2[] = "oooooooou";
+$challenge2[] = "ooooooooo";
+$challenge2[] = "ooooooooo";
+$challenge2[] = "oroooooos";
+$challenge2[] = "ooroooooo";
+$challenge2[] = "ftoooooou";
+$myparams['checkpoints'] = 1;
+$myparams['teleports'] = 1;
+$myparams['walls'] = 2;
+$map2 = GenerateShapedMap($challenge2, $myparams);
+
+$challenge3[] = "otoooooooooan";
+$challenge3[] = "ooooooooooooo";
+$challenge3[] = "ooooooooooooo";
+$challenge3[] = "ooooooooooooo";
+$challenge3[] = "osuofoooooomo";
+
+$myparams['checkpoints'] = 2;
+$myparams['teleports'] = 0;
+$myparams['walls'] = 4;
+$map3 = GenerateShapedMap($challenge3, $myparams);
+
+$challenge4[] = "suooooaooof";
+$challenge4[] = "sooooooooof";
+$challenge4[] = "sooooooooof";
+$challenge4[] = "sooooooorof";
+$challenge4[] = "soooooootof";
+$myparams['checkpoints'] = 1;
+$myparams['teleports'] = 1;
+$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);
+
+//Display maps.
+echo '<div id="tut-1" class="hidden">';
+echo DisplayMap($map1, 1, 'puzzle');
+echo '</div><div id="tut-2" class="hidden">';
+echo DisplayMap($map2, 2, 'puzzle');
+echo '</div><div id="tut-3" class="hidden">';
+echo DisplayMap($map3, 3, 'puzzle');
+echo '</div><div id="tut-4" class="hidden">';
+echo DisplayMap($map4, 4, 'puzzle');
+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 disabled">Next</a>
+ <a href="javascript:tv.prev()" id="prevbtn" class="next hidden">Previous</a>
+ </div>
+</div>
+
+<script>
+var tv = new TutorialView(1, 3);
+tv.showTutorial(1);
+soundManagerInit();
+</script>
+
+<?php
+htmlFooter(array('tutorial'));
+?>