Learning how to make a game using the canvas element with JavaScript