Discuss Scratch
- Discussion Forums
- » Suggestions
- » "Repeat for ___ secs" blocks
- soarroying
-
500+ posts
"Repeat for ___ secs" blocks
This would look weird in the palate. This has a workaround. I think there should be repeat blocks that don't repeat a given number of times, but for a given number of seconds.
How it works is, there's a repeat block like this:repeat (for ___ seconds?)
end
Then you enter how many seconds you want it to repeat.
Please give feedback
reset timer
repeat until <(timer) > [amount v]>
Do something
end
- cooldude-222
-
100+ posts
"Repeat for ___ secs" blocks
What if you need the timer for something
- soarroying
-
500+ posts
"Repeat for ___ secs" blocks
NO IDEA What if you need the timer for something
- IDontNoWatIAm
-
500+ posts
"Repeat for ___ secs" blocks
Something like this? What if you need the timer for something
when green flag clicked
broadcast [time v]
repeat until <(timer) > ((time) + (amount of seconds))> //time of activation added to amount of seconds
blocks
end
when I receive [time v] // saves timer time when the block is called on
set [time] to (timer)
- historical_supa
-
1000+ posts
"Repeat for ___ secs" blocks
That is a stack block however. mayberepeat for (2) secs
- soarroying
-
500+ posts
"Repeat for ___ secs" blocks
GREAT IDEA!!!!Something like this? What if you need the timer for somethingwhen green flag clicked
broadcast [time v]
repeat until <(timer) > ((time) + (amount of seconds))> //time of activation added to amount of seconds
blocks
end
when I receive [time v] // saves timer time when the block is called on
set [time] to (timer)
<(answer) = [Yes v]>
- cooldude-222
-
100+ posts
"Repeat for ___ secs" blocks
What if I need to constantly reset the timer for a stop button detector.Something like this? What if you need the timer for somethingwhen green flag clicked
broadcast [time v]
repeat until <(timer) > ((time) + (amount of seconds))> //time of activation added to amount of seconds
blocks
end
when I receive [time v] // saves timer time when the block is called on
set [time] to (timer)
- 7salad3salad
-
1000+ posts
"Repeat for ___ secs" blocks
I guarantee this one was made before yours, and anyways this is off-topic I already made a forum for this
- RubiksRocker
-
100+ posts
"Repeat for ___ secs" blocks
Something like this? What if you need the timer for somethingwhen green flag clicked
broadcast [time v]
repeat until <(timer) > ((time) + (amount of seconds))> //time of activation added to amount of seconds
blocks
end
when I receive [time v] // saves timer time when the block is called on
set [time] to (timer)
You would need to reset the timer once it receives the message.
when I receive [time v]
reset timer
- WhyDidlMakeThis
-
3 posts
"Repeat for ___ secs" blocks
Uh, what? How will he watch TV if he can't turn it on?
- saverofthewo
-
100+ posts
"Repeat for ___ secs" blocks
the workaround doesn't work, stop sign detector, or anything that utilizes the reset timer block will break it. please stop.
- k0d3rrr
-
1000+ posts
"Repeat for ___ secs" blocks
Bump. This is very useful for projects where you need to repeat something for a certain amount of seconds.
- soarroying
-
500+ posts
"Repeat for ___ secs" blocks
Fixed mockup: mayberepeat for (2) secs
repeat for (2) secs {
} :: control
Last edited by soarroying (Oct. 15, 2022 15:16:24)
- epicboi17
-
100+ posts
"Repeat for ___ secs" blocks
since scratch is 30 fps, you can just
repeat ((seconds) * (30))
end
- Little_Mittle12345
-
100+ posts
"Repeat for ___ secs" blocks
when green flag clickedHmmmmm super hard workaround
repeat for (2) seconds{
glide (1) secs to [random position v]:: motion}:: control
- soarroying
-
500+ posts
"Repeat for ___ secs" blocks
This quote was eaten by an evil bananaWell? The workaround it easy, and you can put it in your backpack so you can use it everywhere.
when green flag clickedOk, maybe saying you could put it in your backpack was a fib sorry :(
set [v v] to [0] //I'm just using v as an example you can name it whatever you want
broadcast [loooop v]
time
When I receive [loooop v]
repeat until <(v)=(insert number here)> //Put the code inside and you're done!
end
define time
repeat until <(v)=(insert number here)>
wait (1) secs
change [v v] by (1)
end
set [v v] to [0]
- Discussion Forums
- » Suggestions
-
» "Repeat for ___ secs" blocks