My first attempt at a JavaScript game