separate game loop method