1. `game` is a global variable. Is this intentional?
2. instead of `window.onload` use `window.addEventListener('load', function() { ... });` If you use .onload it means you can accidentally overwrite another library that was using window.onload; or that library could overwrite your window.onload function.
3. All these `console.logs` are telling me you need to write some tests.