1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
<?PHP
htmlHeader(array('tutorial'));
?>
<body>
<?php
topbar($Links);
?>
<script type="text/javascript" src="sounds/script/soundmanager.js"></script>
<script type="text/javascript">
isChallenge = true;
function challengeGo(mapid) {
var moves = mapjson[mapid].moves;
var tiles = new Array();
switch (mapid) {
case '1':
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 Job, 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')
tiles=["2,3,5","2,4,6"];
markTiles(tiles);
}
break;
case '3':
if (moves == 64) {
flashelement('nextbtn', 15, null, 400);
updateDsp(1, 'instructions', 'I almost confused you! hehe.<br />Next?')
//Unlock next button.
} else {
updateDsp(1, 'instructions', 'The path can travel over the start and end tiles too.<br />')
tiles=["3,3,6","3,4,7","3,3,2","3,2,1"];
markTiles(tiles);
}
break;
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")
//Unlock next button.
} else {
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) {
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();
reqwall[0] = "3,5.";
reqwall[1] = "4,6.";
for(var i in reqwall) {
//alert(solution[mapid].indexOf(reqwall[i]));
if (solution[mapid].indexOf(reqwall[i]) == -1) {
//Failed
return;
}
}
updateDsp(1, 'instructions', 'Excellent; those wall placements look good!<hr />Press Go and see the path it takes')
//indexOf
}
function challengeLoad() {
}
function highlightElement(Eid) {
}
</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 class="col2" style="text-align: center">
<br /> <br />
<strong><div style='height:80px;' id='1,instructions'>
The point of this game is to create the longest <i>path</i> between the start and the finish
<hr />Press Go!
</div>
</strong>
<br />
<?
echo "<a href='#'>Previous</a> | <a href='#' id='nextbtn'>Next</a> ";
//Prepare maps.
$example1[] = "sraoorooof";
$example1[] = "sorooroorf";
$example1[] = "soorooorof";
$example1[] = "sooorrroof";
$example1[] = "soooooooof";
$myparams['teleports'] = 0;
$myparams['walls'] = 0;
$map1 = GenerateShapedMap($example1, $myparams);
$challenge2[] = "sooraooof";
$challenge2[] = "sooorooof";
$challenge2[] = "sooooooof";
$challenge2[] = "sooooooof";
$challenge2[] = "sooooooof";
$myparams['checkpoints'] = 1;
$myparams['teleports'] = 0;
$myparams['walls'] = 2;
$map2 = GenerateShapedMap($challenge2, $myparams);
$challenge3[] = "soooraoof";
$challenge3[] = "sooooroof";
$challenge3[] = "sooooooof";
$challenge3[] = "sooroooof";
$challenge3[] = "soobrooof";
$myparams['checkpoints'] = 2;
$myparams['teleports'] = 0;
$myparams['walls'] = 4;
$map3 = GenerateShapedMap($challenge3, $myparams);
$challenge4[] = "suooooatoof";
$challenge4[] = "sooooooooof";
$challenge4[] = "sooooooooof";
$challenge4[] = "sooooooorof";
$challenge4[] = "sooooooooof";
$challenge4[] = "sooooooooof";
$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 "<br />Target: 35 moves.";
echo DisplayMap($map1, 1, 'puzzle');
echo "<br />Target: 18 moves.";
echo DisplayMap($map2, 2, 'puzzle');
echo "<br />Target: 64 moves.";
echo DisplayMap($map3, 3, 'puzzle');
echo "<br />Target: 45 moves.";
echo DisplayMap($map4, 4, 'puzzle');
echo "<br />Target: 75 moves.";
echo DisplayMap($map5, 5, 'puzzle');
echo "<br />";
echo "<br />";
?>
</div>
<script type="text/javascript">soundManagerInit();</script>
</body>
</html>
|