-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
29 lines (29 loc) · 1019 Bytes
/
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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<title>Workshop</title>
<script type="text/javascript" src="tetris.js"></script>
<script type="text/javascript">
function init() {
console.log('init');
var t = new Tetris('tetris', 25, function(score, lines, level) {
document.getElementById('score').innerHTML = score;
document.getElementById('lines').innerHTML = lines;
document.getElementById('level').innerHTML = level;
});
}
</script>
</head>
<body onload="init()">
<canvas id='tetris' width="350" height="500"></canvas>
<div>
<label>Score:</label><span id='score'></span>
</div>
<div>
<label>Lines:</label><span id='lines'></span>
</div>
<div>
<label>Level:</label><span id='level'></span>
</div>
</body>
</html>