Implemented basic game loop.