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

#1 2009-11-19 16:52:37

AaronC25
Scratcher
Registered: 2009-11-19
Posts: 2

How to create a timer

Does anyone know how to create a timer for my game?
Thanks  smile  This is my FIRST time using scratch  smile

Offline

 

#2 2009-11-19 16:55:51

bosox397
Scratcher
Registered: 2008-02-17
Posts: 1000+

Re: How to create a timer

use the timer block


Dear Scratch Users,
I'm done with scratch, or at least making projects. I have made one last big game, thats both fun and teaches a lesson about water. It'd mean a lot if you gave me feedback.                              http://scratch.mit.edu/projects/bosox397/569201

Offline

 

#3 2009-11-19 16:59:04

AaronC25
Scratcher
Registered: 2009-11-19
Posts: 2

Re: How to create a timer

Like, how do i put it in?
My script currently is When flag clicked
Forever, but the timer block is in a sensing block, so i have to put it in another block right?

Offline

 

#4 2009-11-19 19:34:32

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: How to create a timer

You can create a variable set it to 0 when flag pressed. put it in a loop and say wait 1 sec , increase variable by 1

<when green flag clicked>
<set{ Time }to( 0)>
<forever>
<wait( 1 )secsc>
<change{ Time }by( 1)>
<end>


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#5 2009-11-19 23:40:13

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: How to create a timer

When Green Flag Clicked
reset timer

Or this:

When Green Flag Clicked
set Time to 0
forever
   wait 1 second
   change Time by 1
endforever

EDIT: Oops, the second one is already listed. But why not?

Last edited by Chrischb (2009-11-19 23:40:37)


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

Board footer