/
index.html
28 lines (24 loc) · 1.36 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
<!DOCTYPE HTML>
<head>
<title>Canvas Snake - Experiment by Jonathan Stanton</title>
<script src="snake.js" type="text/javascript" charset="utf-8" async defer></script>
<style type="text/css" media="screen">
dd,dt{ display: inline; }
dd{ margin-left: 5px; }
</style>
</head>
<body>
<h1>Welcome to Canvas Snake</h1>
<p>Direction: Spacebar to start / pause, arrow keys to move.</p>
<dl>
<dt>Points</dt>
<dd id="score">0</dd>
</dl>
<canvas id="snake" width="400" height="400" data-size="10"></canvas>
<p>This is my first javascript game. I think the code is pretty clean, I know of some minor bugs but it's pretty good for an afternoon project. </p>
<p>Some cool features, if you take a look at the source code you will notice all it takes is an element with a ID of "score", a canvas element with an id of "snake", width, height, and data-size attributes.</p>
<p>If you adjust width, height, and the block size the speed of the game will adjust accordingly.</p>
<p>Enjoy!</p>
<a href="https://github.com/JAStanton/Canvas-Snake"><img style="position: fixed; top: 0; right: 0; border: 0; z-index:1000" src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a>
</body>
</html>