-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
60 lines (56 loc) · 2 KB
/
index.html
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
<html>
<head>
<title>FIT2102 A1 2023</title>
</head>
<body>
<div id="leftSide" class="flex col side">
<h2>Game rules</h2>
<ul id="leftList">
<li>100 points are awarded for each row cleared</li>
<li>Game speed increases after reaching 200 score</li>
<li>The game restarts automatically after showing game over box briefly</li>
<li>Highscore is tracked until page is refreshed</li>
<li>If player achieves a new highscore but restarts game manually, the new highscore is retained</li>
</ul>
</div>
<div id="centerContent" class="flex col">
<h1>Tetris</h1>
<main id="main" class="flex row">
<svg id="svgCanvas">
<!-- game over text box -->
<g id="gameOver" visibility="hidden">
<rect x="26" y="120" fill="white" height="48" width="149"></rect>
<text x="36" y="150">Game Over</text>
</g>
</svg>
<div id="sideBar" class="flex col">
<svg id="svgPreview">
</svg>
<div id="info" class="flex col">
<div class="text">
<span class="left">Score: </span>
<span class="right" id="scoreText">...</span>
</div>
<div class="text">
<span class="left">Highscore: </span>
<span class="right" id="highScoreText">...</span>
</div>
</div>
</div>
</main>
</div>
<div id="rightSide" class="flex col side">
<h2>Playing instructions</h2>
<ul id="rightList">
<li>`A` button: Move block left</li>
<li>`D` button: Move block right</li>
<li>`S` button: Move block down</li>
<li>`H` button: Hold the block. (Press H again to unhold)</li>
<li>`E` button: Rotate block clockwise</li>
<li>`Q` button: Rotate block anti-clockwise</li>
<li>`R` button: Restart game</li>
</ul>
</div>
<script type="module" src="./src/main.ts"></script>
</body>
</html>