Image 15-Puzzle mechanics

The HTML Document

Firstly, we'll create a HTML Document with a reference to our external Javascript file in the head (which we'll call image-puzzle-game.js), and a Canvas element in the Body, with a width and height of 400 and 300 pixels respectively and the id game:

<!DOCTYPE html>

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


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

Page loaded in 0.009 second(s).