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

#1 2011-10-05 14:34:41

jjman713
Scratcher
Registered: 2011-09-28
Posts: 3

Timer?

I'm wanting to make a Rubik's cube timer and want it to go up in milliseconds but don't know how to unless I use each millisecond as a costume and make it go up. Is there a faster way to make a timer that goes up at least for a minute? Please help!!!

Offline

 

#2 2011-10-05 14:38:18

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Timer?

Create one sprite with the costumes for 0 to 9 for each digit of your timer. You can use the (letter () of []) block in Operators to set each one to a different digit of the current time, so:

switch to costume[(letter(1) of (time))]

P.S. This isn't really an advanced question and should be asked in the "All about Scratch" forum  smile  Read this thread if you're wondering what goes in advanced topics  smile


Good luck!

Last edited by sparks (2011-10-05 14:39:47)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#3 2012-01-18 14:21:31

jjman713
Scratcher
Registered: 2011-09-28
Posts: 3

Re: Timer?

i actually meant a time for like 5 minutes or so. it would be very convenient if you didn't have to make a sprite for each number.  lol

Offline

 

#4 2012-01-18 14:40:08

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Timer?

jjman713 wrote:

i actually meant a time for like 5 minutes or so. it would be very convenient if you didn't have to make a sprite for each number. :lol:

Look. You need to compromise. Either use a variable watcher or make one costume per digit or do this:

count = 0
go to x:(0) y:(0)
repeat(length of(time))
     change count by (1)
     switch to costume(letter(count) of time)
     stamp
     change x by (10)


otherwise you could download Panther and add the stamp text [] at x:() y:() font [] size () color [o] block from the block library.

Last edited by sparks (2012-01-18 14:40:19)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

Board footer