-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
30 lines (30 loc) · 1.05 KB
/
Copy pathindex.html
File metadata and controls
30 lines (30 loc) · 1.05 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
<!DOCTYPE html5>
<html>
<head>
<link rel="stylesheet" href="style.css"></link>
<title>HTML5 Snake</title>
</head>
<body>
<div class="main">
<canvas style="display: none;" height="600" width="800" id="game"></canvas>
<form id="menu" class="menu" onsubmit="return false;">
<button href="#" id="start" class="play">New Game</button>
<hr>
<h4>Options:</h4>
Horizontal Tiles: <input type="text" value="16" id="width">
Vertical Tiles: <input type="text" value="12" id="height">
Starting Length: <input type="text" value="3" id="initiallength">
Move Rate (less=faster) <input type="text" value="10" id="moveRate"><br>
<input type="checkbox" checked id="wraparound">Enable "Wrap Around"</input>
</form>
</div>
<script src="snake.js"></script>
<script>
start.onclick= function () {
g = new Game(game, width.value, height.value, initiallength.value, wraparound.checked, moveRate.value)
game.style.display = 'inline-block';
menu.style.display = 'none';
}
</script>
</body>
</html>