This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-05-20 11:16:10

blacksheepk
Scratcher
Registered: 2007-05-19
Posts: 6

How do u make the timer count down to zero?

How do u make the timer count down to zero?

Offline

 

#2 2007-05-20 11:22:45

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: How do u make the timer count down to zero?

The timer always counts up.  If you want a countdown, set a variable to 10 and count it down with
   repeat 10
       wait 1 sec
       change counter by -1

Offline

 

#3 2007-05-20 12:06:52

Duncan
Scratcher
Registered: 2007-05-15
Posts: 47

Re: How do u make the timer count down to zero?

If you want to use the timer you could bodge it with something like...


Make a variable ShowTime

and use two scripts (assuming a countdown from 10):

When Sprite Clicked (or whatever trigger you are using)
Broadcast CountDown



When I Receive CountDown
Reset Timer
Set ShowTime to 10
Repeat until ShowTime=0 or ShowTime<0
  Set ShowTime to 10-timer



It needed the OR as it did not always pick up the = 0

Offline

 

#4 2007-08-10 08:57:56

gne
Scratcher
Registered: 2007-08-07
Posts: 22

Re: How do u make the timer count down to zero?

Thanks for that information! I have a 2 minute countdown timer sprite availlable for free download here
http://www.scratch.mit.edu/projects/gne/28154
which I made. Feel free to use it!

Last edited by gne (2007-08-10 09:13:31)

Offline

 

Board footer