@JohnMcDonald
public void runServer() {
final int TICKS_PER_SECOND = 25;
final int SKIP_TICKS = 1000 / TICKS_PER_SECOND;
final int MAX_FRAMESKIP = 5;
long next_game_tick = System.nanoTime();
int loops;
float interpolation;
boolean game_is_running = true;
while( game_is_running ) {
loops = 0;
while( System.nanoTime() > next_game_tick && loops < MAX_FRAMESKIP) {
//update game
world.step(1.0f / 60.0f, 6, 2);
next_game_tick += SKIP_TICKS;
loops++;
}
interpolation = System.nanoTime() + SKIP_TICKS - next_game_tick