A simple Java game loop