attach game loop to index.js