How do I set a boolean for a specified amount of time, then reset it?
Question
I basically want a method I can call that will set a boolean to true for 2 seconds, then reset it to false. How would I do this?
I'm using the Slick library which is dependent on LWJGL.
Solution
You want to look at the Timer class.
OTHER TIPS
check out the ScheduledExecutorService and the method schedule()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow