Snake Game

The HTML Document

To begin with, we'll create a HTML document. I've called mine "snake.htm". This will be a simple bare-bones webpage that includes reference to an external Javascript (which I've called "snake-game.js"), and a Canvas element with the ID game, and a width and height of 300px and 400px respectively.

<!DOCTYPE html>

<script type="text/javascript" src="snake-game.js"></script>


<canvas id="game" width="300" height="400"></canvas>


This is it for our HTML - we'll continue the rest of the game in Javascript.

Page loaded in 0.01 second(s).