A Java game loop