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

#1 2010-08-08 18:30:32

asuul714
New Scratcher
Registered: 2010-08-05
Posts: 11

Repeat block as a time filler

Instead of using the wait () secs block, the repeat () block can be used to wait a certain amount of time that will change depending on the quality of the computer. Please let me know if this was any use to you.

~asuul714

Offline

 

#2 2010-08-09 03:33:47

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Repeat block as a time filler

Yeah, the Repeat () block can be used for very short pauses. RHY3756547 used it a lot.  smile


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2010-08-09 13:06:31

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Repeat block as a time filler

Another thing that I like to use for synchronising projects (e.g. making a sprite's mouth move in time with a sound) is this:

[blocks]<wait until><( <timer> <>> number )>[/blocks]

I also use empty repeats for short waits  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#4 2010-08-09 13:23:49

Telemachus
Scratcher
Registered: 2010-04-21
Posts: 500+

Re: Repeat block as a time filler

Wow, I didn't know this! Thanks for the information. I always used wait 0.001 seconds or something like that.


http://i54.tinypic.com/10h0fnp.jpg

Offline

 

#5 2010-08-09 16:31:50

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Repeat block as a time filler

Yeah, an empty repeat one block is useful for things that you only need to wait one frame for, for example making sure another sprite senses collision before hiding.


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#6 2010-08-09 19:17:12

graham7sarah9
Scratcher
Registered: 2009-07-19
Posts: 28

Re: Repeat block as a time filler

Statistically, the repeat block takes about 1/40th of a second if you have an empty repeat 1. Repeat 2 would be 2/40ths, and so on. Except for the fact that the higher the number, the more lag comes. A repeat of 40 times repeats 40.404040404 times per second, whereas 100 repeats somewhere near 39 times per second. I have failed to test 1 time because the result is a crazy number that is about 333

Offline

 

Board footer