A Java game loop.