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

#1 2012-04-12 13:42:21

fortmcas
Scratcher
Registered: 2009-07-26
Posts: 48

Clocks

I need a script that runs down a timer on the top of the screen.  Can anyone help????

It is for my new game,  Ocean Rescue

Offline

 

#2 2012-04-12 13:54:01

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Clocks

fortmcas wrote:

I need a script that runs down a timer on the top of the screen.  Can anyone help????

It is for my new game,  Ocean Rescue

As in the timer? There's a built in timer in the sensing category. But make sure to include a

when gf clicked
reset timer
script, the timer keeps going even after you click the stop sign.

Offline

 

#3 2012-04-12 13:56:23

fortmcas
Scratcher
Registered: 2009-07-26
Posts: 48

Re: Clocks

Sorry, Thanks!!

Offline

 

#4 2012-04-12 14:19:35

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Clocks

If you want a timer to count down than use this:

when gf clicked
reset timer
forever
set [Time Remaining v] to ((starting time)-(timer))
And display the "time remaining" variable.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-04-12 14:19:41

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Clocks

Create a timer variable and say

when i receive [start v]
 set [time left v] to (30) // or however much time you want
 forever // or "repeat until time left = 0" or whatever 
  change [time left v] by (-1)
   wait (1) second
 
I'm not sure that it is possible that you can make the timer go backwards. But, if you want the 1/10 seconds and 1/100 seconds of the timer, do
set [time left] to (30.00)
repeat until < [time left v] > (0) >
 change [time left v] by -0.01
 wait (0.01) seconds
 


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

Board footer