Simple Maze Example
In this example I use a 2D array to store the game board. In the array 1 represents a wall, 0 is free space, and -1 is the goal. The draw function is called once on load and then is called every time the user presses a key.
Click in the maze window then use the arrow keys to navigate the maze with the blue dot.
There's a bit of a scrolling issue when embedding the game. To view without the scrolling issue go to JSFiddle.