-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgame.html
29 lines (27 loc) · 994 Bytes
/
game.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
<!DOCTYPE html>
<html>
<head>
<title>Snake JS</title>
<link rel="stylesheet" href="style.css"/>
<script src="snake.js" type="text/javascript"></script>
</head>
<body>
Instructions: Enter the amount of food you want, hit submit, <em>then</em> click "Start"
<div id="info">
<span id="lengthEl">Snake Length: <span id="score"></span></span>
<span id="hiscoreEl">High Score: <span id="hiscore">0</span></span>
<button id="start">Start</button>
<button id="restart">Restart</button>
</div>
<div id="fieldEl">
</div>
<span id="youlose">GAME OVER<br><a id="tryagain">Try Again</a></span>
<label for=foodNum>How much food?</label><input type="text" id=foodNum>
<button id="submit">Go!</button>
<script>
document.getElementById("submit").onclick = function() {
Object.create(SnakeGame).init(parseInt(document.getElementById("foodNum").value, 10));
};
</script>
</body>
</html>