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

#1 2010-08-09 17:11:23

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Timer Trouble!!! [HELP!]

When timer gets to __ [2min], stop game.

How do you do it???


HELP!!!!!!!!!!!

(This is my first time with the timer.)


IHeartGaming   smile


IHeartGaming

Offline

 

#2 2010-08-09 17:22:05

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Timer Trouble!!! [HELP!]

Code:

When green flag clicked
wait until timer > 2
stop all

Make sure it's the > symbol, not the equals symbol.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2010-08-09 19:05:19

graham7sarah9
Scratcher
Registered: 2009-07-19
Posts: 28

Re: Timer Trouble!!! [HELP!]

Harakou wrote:

Code:

When green flag clicked
wait until timer > 2
stop all

Make sure it's the > symbol, not the equals symbol.

That's a nice explanation, there are a few things that could be potentially confusing.
You forgot a couple things:

Code:

When green flag clicked <- you had that
reset timer <- don't forget to reset the timer otherwise it will stop almost immediately
wait until timer > 120 <- the timer counts in seconds, not in minutes*
stop all <- that or gameover logic, but you had it correct

*The counter counts by 0.1, so it counts every tenth of a second. Because Scratch operates a C block in 1/40th of a second, and stack blocks a little faster, it may miss the queue if you use '=' instead of '>.' If you want real accuracy, make it:

Code:

wait until timer > 119.9

but it doesn't really matter.

Offline

 

Board footer