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

2013/3/12

countdown time by second

laziaf laziaf

2013/3/12

#
i have a trouble, I made a game using a countdown timer using Edit> import class> counter, a maximum of 40 to 0, and if up to 0 game over. the problem is, time is running very fast, and I do not know how to slow down time as a matter of seconds. I need your help. thanks
steved steved

2013/3/12

#
just pick a higher number. Dont slow down the time because if you do that movement will not work properly. every act the do the stuff you only notice the end result of each act seeing as each act goes as fast as your computer can handle the code. lets say you want 40 seconds try setting it to a number like 1000 test and see how long that is. then adjust the number based on how long it took.
davmac davmac

2013/3/12

#
Please don't create multiple discussions for the same topic. (I've deleted your other post).
danpost danpost

2013/3/12

#
Chances are you want to use game-time, not real-time; so using a count-down timer is the way to go. An average scenario runs about 60 frames per second, so for 40 seconds, use 2400 as your initial value (40 * 60). Subtract one from the timer and check its new value every act. When it reaches zero process your game over code.
laziaf laziaf

2013/3/16

#
@steved, okay.. tq @davmac, ups sorry. ok. i'll never do that again @danpost, ok, i'll try. tq
You need to login to post a reply.