In Java slick2d , i started printing out Delta which is supposed to be the time and it prints out is 16 or 17 forever, so how does this help me if i want to tell an object when it needs to do something, example : IF (createdtime + 60miliseconds < delta )

60miliseconds after its creation , do something


1 Answer 1


Delta time is the amount of time since the last update. You're getting 16 or 17 because it has been 16 or 17 milliseconds since the last update. If you want to know how long your game has been running, do something like:

long runningTime = 0; //declared outside the update loop

//in update loop put:

runningTime += deltaTime;

if(runningTime > 60)
    //do something every frame after 60 milliseconds.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .