-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
39 lines (38 loc) · 1.75 KB
/
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
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html>
<head>
<title>Snake Game</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- font awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<link rel="shortcut icon" type="image/jpg" href="ktjlogo.png">
<link rel="stylesheet" type="text/css" href="indexstyle.css">
</head>
<body>
<div class="row">
<div class="col l6 m12">
<h1 id="go">Play The Snake Game</h1>
<span id="pa"></span><br>
<h3>Your score:<b id="score">0</b></h3><br>
<button onclick="startGame1()"><b>start(slow)</b>
</button><button onclick="startGame2()"><b>start(medium)</b></button>
<button onclick="startGame3()"><b>start(fast)</b></button><br>
<button id="pauseBtn" onclick="pause()"><b>Pause</b></button>
</div>
<div class="col l6 m12" style="text-align: center;">
<canvas id="canvas" width="500" height="500"></canvas><br>
<button onclick="dirControl2(38)" class="ctrl">up</button><br>
<button onclick="dirControl2(37)" class="ctrl">left</button>
<button onclick="dirControl2(40)" class="ctrl">down</button>
<button onclick="dirControl2(39)" class="ctrl">right</button><br>
</div>
</div>
<script src="indexJS.js" ></script>
</body>
</html>