i no this is stupid but how do u make the timer stop after all the commands stop (when the game is over: When my cow trun into the object) I would like to be able for the timer to stop and to be able to see what time i got.
the stop all button dont seem2 work though.
thanks
Last edited by Yargleman (2008-07-13 15:59:04)
Offline
<stop all> is one way to do it. Another would be:
<if><( <{ Timed }> <=> 1 )>
<reset timer>
<stop script>
Offline
Zelda123 wrote:
Bluestribute wrote:
Another would be:
<if><( <{ Timed }> <=> 1 )>
<reset timer>
<stop script>This would set the timer to 0 and you wouldn't be able to see what the timer was set at.
You would broadcast first and than change the variable. It would happen after the point you want it to reset
Offline
Funny discovery, Yargleman!
I never noticed that the timer doesn't stop once the red stop button is pressed (or the according block invoked), but I guess that's quite intentional (after all, time never stops, doesn't it?). If I were you I'd try saving the elapsed time to a variable instead of displaying the timer itself on the stage (that might have been what Bluestribute actually meant).
You could reset the timer when a game starts:
[blocks]
<when I receive[ new game
<reset timer>
[/blocks]
Once the game is over you could make a 'snapshot' of the timer:
[blocks]
<when I receive[ game over
<set{ elapsed time }to( <timer>
<say[ this game took ]for( 1 )secs>
<say[ <{ elapsed time }> ]for( 1 )secs>
<say[ seconds
[/blocks]
Another idea would be to also reset the 'elapsed time' variable each time a new game commences and setting it to the timer during a loop that stops once the game is over. That way you could always show the 'elapsed time' variable on the stage and watch it while playing.
Hope that helps...
Offline
Jens wrote:
If I were you I'd try saving the elapsed time to a variable instead of displaying the timer itself on the stage (that might have been what Bluestribute actually meant):
Actually, I DID use a variable, but it "stopped" the timer by using a variable. But your way seems better. Actually, a lot better
Offline
Use a variable by every 1 second it increases by 1 AND DON'T FORGET!
<when green flag clicked>
<set{ timer }to( 0
So it should look like this!
<when green flag clicked>
<set{ Timer }to( 0 )
<forever>
<change{ Timer }by( 1 )
<end>
Last edited by registeel (2008-07-15 13:47:10)
Offline
registeel wrote:
Use a variable by every 1 second it increases by 1 AND DON'T FORGET!
<when green flag clicked>
<set{ timer }to( 0
So it should look like this!
<when green flag clicked>
<set{ Timer }to( 0 )
<forever>
<change{ Timer }by( 1 )
<end>
That's what I usually do to. It works just fine, and it stops when you want it to!
Offline
Paddle2See wrote:
registeel wrote:
Use a variable by every 1 second it increases by 1 AND DON'T FORGET!
<when green flag clicked>
<set{ timer }to( 0
So it should look like this!
<when green flag clicked>
<set{ Timer }to( 0 )
<forever>
<change{ Timer }by( 1 )
<end>That's what I usually do to. It works just fine, and it stops when you want it to!
I find that the time is a bit off, even if you do the wait 1 second, just because the timing is off.
Offline
Jens wrote:
Good idea, registeel! I think you should add a 'wait 1 sec' block into the forever loop, though...
Woops i forgot to do that
Offline
If the variable timer is off, try changing it to somewhere bewteen wait 0.9 or 0.99
Offline