This site requires JavaScript, please enable it in your browser!
Greenfoot back
badatcoding1325
badatcoding1325 wrote ...

2020/1/8

Restart Timer

badatcoding1325 badatcoding1325

2020/1/8

#
How would one automatically restart a timer without the simulation having to be run again? Like the displayed timer would reach 0 and then start again from its starting point
danpost danpost

2020/1/8

#
badatcoding1325 wrote...
How would one automatically restart a timer without the simulation having to be run again? Like the displayed timer would reach 0 and then start again from its starting point
Just remove the old timer from the world and replace it with a new one (also, replacing the field reference your World object has to that new Timer object)
badatcoding1325 badatcoding1325

2020/1/8

#
okay, but in the world how do I get if the timer is over or not, all of that is in my Timer class and Idk if/how I can access that information
danpost danpost

2020/1/8

#
badatcoding1325 wrote...
okay, but in the world how do I get if the timer is over or not, all of that is in my Timer class and Idk if/how I can access that information
If the timer removes itself from the world, then the world would only need to check that a timer is not in it; or, that the gif that it runs has been added, ran and removed.
badatcoding1325 badatcoding1325

2020/1/9

#
OH. Thank you
You need to login to post a reply.