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

#1 2010-02-21 13:58:53

tombot7
Scratcher
Registered: 2010-02-21
Posts: 1

How to create a scoring metric for time

I have to create a script that allows me to use time as a scoring metric.  Does anyone know a quick script to create that?  Thanks!

Offline

 

#2 2010-02-21 14:22:15

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: How to create a scoring metric for time

I can think of a couple of different approaches here...some sort of survival game where the longer you last (greater time) the higher your score.  The score could even be the time.  The other approach might be a racing game where the shorter your time, the higher your score.  In that case you could make the score equal to some large base value minus some multiple of the time to complete the race.

In either case, you could use the Reset Timer block (in Sensing) to zero the timer when things start and they use the Timer value when it comes time to compute the score.

Is that the sort of thing you are looking for?


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2010-02-21 14:24:47

Ace-of-Spades
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: How to create a scoring metric for time

You should also mention that he can use the timer as a number variable (you grab the light blue Timer button and drag it into where it needs to be placed) in case he was asking about how he can use them.

[unfortunately I can't use blocks to show an example of a script]

Last edited by Ace-of-Spades (2010-02-21 14:25:34)


11110010100011010100011010101000100011011011001010111100101000110101000110101010001000110110110010101111001010001101010001101010100010001101101100101011110010100011010100011010101000100011011011001010
110101010010001010101010101010101010101010100110101010010101010010101001101011010101010010101010101

Offline

 

Board footer