-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (35 loc) · 1003 Bytes
/
Copy pathindex.html
File metadata and controls
41 lines (35 loc) · 1003 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Snake Game</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="container">
<h1>🐍 SNAKE</h1>
<div id="scoreboard">
<div class="score-box">
<span class="label">SCORE</span>
<span class="value" id="score">0</span>
</div>
<div class="score-box">
<span class="label">BEST</span>
<span class="value" id="best">0</span>
</div>
</div>
<canvas id="gameCanvas" width="400" height="400"></canvas>
<div id="message" class="hidden">
<h2 id="messageText">Game Over</h2>
<p id="finalScore"></p>
<button id="restartBtn">▶ Play Again</button>
</div>
<div id="controls">
<p>Arrow keys or WASD to move</p>
<p>Press <strong>Space</strong> to pause</p>
</div>
</div>
<script src="game.js"></script>
</body>
</html>