Discuss Scratch

AeonPunk
Scratcher
13 posts

How to measure time?

I was hoping to set a score sistem based on te survival time of the character for my arcade-type game

Can anyone gimme some tip on how to calculate time?
Do you know of any game that already uses this feature?
AeonPunk
Scratcher
13 posts

How to measure time?

Update! I found the
(timer)
block to do this
That was actually pretty easy!
Prinseskat
Scratcher
1000+ posts

How to measure time?

Another way to have a timer, which you can start later in the game and you can add or remove seconds, is to have something like this:
when I receive [start timer v]
set [Timer v] to [0]
repeat (30)
wait (1) secs
change [Timer v] by (1)
if <touching color [#ff0088] ?> then
change [Timer v] by (5)


end


end
say [Time's up!] for (2) secs
I'm not sure if you can change the value of the
(timer)
or not, but I prefer this way anyway. Also means you can have just seconds/minutes instead of milliseconds.
AeonPunk
Scratcher
13 posts

How to measure time?

Actually, now that you mention it, i guess that's a better way to do it, the miliseconds count is kinda annoying to read

To programm an infinite counter

when green flag clicked
set [minutes v] to [0]
set [seconds v] to [0]
forever

wait (1) secs
change [seconds v] by (1)
end

when green flag clicked
forever

if <[seconds] > [60]> then

change [minutes v] by (1)
set [seconds v] to [0]
end

end
AeonPunk
Scratcher
13 posts

How to measure time?

Thanks for the help, btw
Prinseskat
Scratcher
1000+ posts

How to measure time?

AeonPunk wrote:

Thanks for the help, btw
You are welcome.
Mystery96
Scratcher
100+ posts

How to measure time?

look at the topic id
musicROCKS013
Scratcher
1000+ posts

How to measure time?

Mystery96 wrote:

look at the topic id
:facepalm: Please don't necropost.

Powered by DjangoBB