-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (49 loc) · 1.17 KB
/
index.html
File metadata and controls
54 lines (49 loc) · 1.17 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title> Snake Game </title>
<script type="text/javascript" src="lib/class.js"></script>
<script type="text/javascript" src="core.js"></script>
<script type="text/javascript" src="snake.js"></script>
<style>
div#snakeGame {
position: relative;
margin: 0 auto;
/*background-color: #FABADA;*/
border: 1px solid black;
}
div.tile {
position: absolute;
background-color: #0000FF;
border-radius: 9px;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
}
div.tile.snake {
background-color: #00FF00;
}
div.tile.eat {
background-color: #0000FF;
}
div.score {
position: absolute;
font-size: 18px;
}
div.gameOver {
position: absolute;
font-size: 30px;
color: red;
}
</style>
</head>
<body>
<div id="snakeGame" style="width:500px"> </div>
<script type="text/javascript">
window.onload = function () {
var game = new SnakeGame('snakeGame');
game.start();
}
</script>
</body>
</html>