Currently my project has no timing and is satisfactory but it would be a lot cleaner if I had timing. I would like to have it so after I declared whatever needs to be I can do something like:
if (timer == 2000) {
System.out.println("2 seconds have passed since "timer" was declared!");
}
I haven't seen that much that went over this. Sorry if I'm missing something. I'm just looking for the best way to do this.
EDIT
I've been asked for more detail on why I need this so... btw this is for a zombie game
while(!Display.isCloseRequested()){
if (whatever == 2 seconds){ //I obviously know a don't right the word seconds next the number 2
for(int z = 0; z < 2; z++){
SpawnaZombieAt(leftcorner,20,speed);
}
}
}
if I'm not clear enough I am trying to start some sort of timer. then for every 2 seconds or so 2 more zombies will spawn