Discuss Scratch

SpringTrapDX
Scratcher
2 posts

How to add time to your Scratch Projects

h

Last edited by SpringTrapDX (July 20, 2015 08:17:57)

Tikolu
Scratcher
85 posts

How to add time to your Scratch Projects

This is not a block.
Thejbomber
Scratcher
100+ posts

How to add time to your Scratch Projects

1. This section is where you ask how to do things.
2. That's not a block.
3. To get time, you click the check box next to the current minute block.
applesauceepicness
Scratcher
500+ posts

How to add time to your Scratch Projects

You could also use the timer and just use this script:
when green flag clicked
reset timer

Well you should just make sure that you add either show timer/hide timer

Last edited by applesauceepicness (July 20, 2015 14:22:54)

Thejbomber
Scratcher
100+ posts

How to add time to your Scratch Projects

Oh well you edited it out.
Creator1972
Scratcher
26 posts

How to add time to your Scratch Projects

It's pretty simple.

You see, we have this block:

(timer)

And this:

reset timer

We can make a variable that stores this, using this script:

when green flag clicked
set [ Timer] to [(timer) ]


Just make the second timer be the blue block (timer) that I showed earlier. We also have:



when [ v] > (10)


Insert timer in that space again.





Hope I helped!

Creator1972
Thejbomber
Scratcher
100+ posts

How to add time to your Scratch Projects

Guys I think they meant time as in 12:00, not a stopwatch.
If you want actual time, use this.
when green flag clicked
forever

set [Minutes v] to [ (current [minute v])
if <(current [hour v]) < [13 ]> then

set [hour v] to [(current [hour v]) ]
end
if <not <(current [hour v]) < [13 ]>> then
set [hour v] to [((current [hour v]) - (12)) ]

end

end
Thejbomber
Scratcher
100+ posts

How to add time to your Scratch Projects

So apparently scratchblocks doesn't like operators. So for the “if not” block, use this instead.
((hours) - (12))
And for some reason the variables section comes out red.
set [hours v] to [ ]
Thejbomber
Scratcher
100+ posts

How to add time to your Scratch Projects

Oh so now it doesn't smh
juicykiwi-
Scratcher
10 posts

How to add time to your Scratch Projects

So there is a time block that reports any unit of time you want. To get the current time, join these blocks:

(join (current [hour v]) (join [:] (current [minute v])))

However, that will only give you the military time. To fix this, you need to use a mod block in the hour spot, saying

((current [hour v]) mod (12))

which will always give you a number less than 12. For instance, if the time is 5:30 PM, then it will normally read 17:30. This block will change it to 5:30. The mod block finds the remainder of a division problem.
TheGirlThatLovesToc
Scratcher
4 posts

How to add time to your Scratch Projects

scratchblocks]
say for (2) secs
Vibrato
Scratcher
1000+ posts

How to add time to your Scratch Projects

TheGirlThatLovesToc wrote:

scratchblocks]
say for (2) secs
please don't necropost

Powered by DjangoBB