split game loop and animation loop