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

2013/7/2

Need help

MagicFish MagicFish

2013/7/2

#
I wrote a "Clock" class which calculates the time since calling the constructor method or the method restart() (System.currentTimeMillis() to mesure the current time). The problem is obviously that if someone pauses the program he can simply cheat himself unlimited time. Is there any way to get notified if pause has been used before the current frame / act. Then I could simply substract the spf (seconds per frame) from the playing time. Thank you!
Gevater_Tod4711 Gevater_Tod4711

2013/7/2

#
If the execution of the game has been stopped the method stopped() in World is called. If you overwrite this method in your world class you can easily check whether the game was paused. If you need to know the methods greenfoot provides it's always good to have a look at the Greenfoot API.
MagicFish MagicFish

2013/7/2

#
Gevater_Tod4711 wrote...
If the execution of the game has been stopped the method stopped() in World is called. If you overwrite this method in your world class you can easily check whether the game was paused. If you need to know the methods greenfoot provides it's always good to have a look at the Greenfoot API.
Thanks! I did it.
You need to login to post a reply.