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
|
<?php
htmlHeader(array('tutorial'));
?>
<body>
<?php
topbar($Links);
include('./includes/maps.php');
// function GenerateMap($rows, $cols, $rockchance, $numBlocks = -1, $cp = -1, $tp = -1) {
//$map = GenerateMap(6, 3, 1000, 3, 5, 0);
//$mapcode = GenerateMapCode($map);
//echo "$mapcode <br />";
//echo displaymap($map, 0, true);
//Demo nothing.
$basicmapcode = '6x3.c0.r0.w9.t0.:0s.4f.0s.4f.0s.4f.';
$basicmap = displaymap(GenerateMapByCode($basicmapcode), 1, 'example');
//Map Demoing the checkpoints
$cpcode = "6x3.c5.r0.w9.t0.:0s.0a.2b.0f.0s.1e.2f.0s.0d.2c.0f.";
$cpmap = displaymap(GenerateMapByCode($cpcode), 2, 'example');
//Map Demoing the teleports
$tpcode = "6x3.c0.r0.w5.t4.:0s.0n.2t.0f.0s.4f.0s.0u.2m.0f.";
$tpmap = displaymap(GenerateMapByCode($tpcode), 3, 'example');
?>
<div class="wrapper">
<div id="tut-0" class="hidden">
<h1 style="margin-bottom: 0">Tutorial</h1>
<p>
<br />The object of the game is to make the longest maze.
<br />The "Snake" (name pending) must go to all the checkpoints.
<br />It starts from the start squares:
<table><tr><td class='grid_td_start'></td></tr></table>
and goes to the end squares:
<table><tr><td class='grid_td_finish'></td></tr></table>
<br />Build a maze by clicking to place blocks. You can remove a block by clicking it again.
<br />It must be able to make it through your maze, so no walling completely!
</p>
<p>Try it:
<? echo $basicmap; ?>
</p>
<br />
<a href="javascript:showTutorial(1)" class="next">Next</a>
</div>
<div id="tut-1" class="hidden">
<h2>Checkpoints:</h2>
<table>
<tr>
<td class='grid_td_cpa'></td>
<td class='grid_td_cpb'></td>
<td class='grid_td_cpc'></td>
<td class='grid_td_cpd'></td>
<td class='grid_td_cpe'></td>
</tr>
</table>
<p>
The path must reach all these (if they exist) before going to finish. Try it:
<? echo $cpmap; ?>
</p>
<br /><br />
<p>
Tip: - Try to combine odd-letters with each other;
<br />I.E. If A, B, C exist, try to make a box around A and C, then maze the entrance to the box.
<br />This way, the path enters the box for A, leaves for B, returns for C, and leaves for the exit.
This would make the path go through your maze 4 times!
</p>
<a href="javascript:showTutorial(2)" class="next">Next</a>
<a href="javascript:showTutorial(0)" class="next">Back</a>
</div>
<div id="tut-2" class="hidden">
<h2>Teleports:</h2>
<table class="padded">
<tr>
<td>Teleport 1:</td>
<td class='grid_td_tp1_in' ></td>
<td class='grid_td_tp1_out' ></td>
</tr>
<tr>
<td>Teleport 2:</td>
<td class='grid_td_tp2_in' ></td>
<td class='grid_td_tp2_out' ></td>
</tr>
</table>
<p>
<br />Teleport tiles are traps. When the path goes across the "IN" tile, it gets thrown to the "OUT" tile.
<br />The path will not avoid teleports. Check this example out:
<div style='width:200px;'>
<? echo $tpmap; ?>
</div>
<br />
<br />
Implementing a teleport into your maze can have a big impact.
</p>
<br /><p>That should be enough information to get you started.
<br />Now <a href='?page=home'>go try it out!</a>
</p>
<a href="javascript:showTutorial(1)" class="next">Back</a>
</div>
</div>
<script>
function showTutorial(num) {
for (var i = 0; i < 3; 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', '');
}
showTutorial(0);
</script>
<?php
htmlFooter();
?>
|