trying to sort out a way for game.js not to have one billion lines of code