lib/game.js: add constants and missing tick function