Changing the game.js to a jQuery plugin: