From 147d60865d5fdbd9a867c645c6bbde4c1256a93f Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 15 Nov 2011 00:17:46 -0800 Subject: Tutorial, Map Position:'s, Solver. --- pages/tutorial.php | 55 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 11 deletions(-) (limited to 'pages/tutorial.php') 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!
Lets move on to the next shall we?'); + updateDsp(1, 'instructions', "Great, that's 18 moves!
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.
Place 2 walls where it\'s flashing to make the path longer'); + updateDsp(1, 'instructions', "The goal for this map is 18 moves.
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.
Next?'); + updateDsp(1, 'instructions', '

I almost confused you! hehe.

Next?

'); //Unlock next button. } else { - updateDsp(1, 'instructions', 'The path can travel over the start and end tiles too.
'); + updateDsp(1, 'instructions', '

The path can travel over the start and end tiles too.


'); 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!
Press Go and see the path it takes') + updateDsp(1, 'instructions', 'Excellent; those wall placements look good!
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', '

The point of this game is to create the longest path between the start and the finish.

Press Go!

'); + flashelement('1,btn', 10, null, 400); + break; + case 2: + updateDsp(1, 'instructions', "

Let's start off simple;

Start by pressing 'Go!' first.

"); + break; + case 3: + updateDsp(1, 'instructions', "The goal for this map is 64 moves
Press 'Go!'"); + break; + case 4: + updateDsp(1, 'instructions', "Teleports are traps. See if you can use the teleport to reach 45 moves!
Press 'Go!'"); + break; + case 5: + updateDsp(1, 'instructions', "Now for a difficult one. The goal for this one is 75 moves.
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 ''; ?>
- +
-- cgit v1.2.3