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

#1 2010-04-11 22:32:50

knight5656
Scratcher
Registered: 2009-12-09
Posts: 29

repeat for [] seconds block!

this block has been discovered by me with few problems (works best in turbo speed)
<when green flag clicked><set{ variable }to( 0 )<repeat until><( <{ variable }> <>> number )><move( 10 )steps><turn cw( 15degrees><change{ variable }by( 1 )


This paragraph has odd things to it. It looks a normal paragraph, but this is not a normal paragraph, if you know what is funny about it, post your thought in a location so that I will find it. if you think that it's normal, look at my writing! You might think it's normal, if you think coaching will aid you, try that! But not many humans will find odd things about this paragraph.

Offline

 

#2 2010-04-12 03:15:39

HelenWonky
Scratcher
Registered: 2009-12-16
Posts: 100+

Re: repeat for [] seconds block!

We really need a block for that!  For now though, we can always do this:

For the action:
<when I receive[ turn
<repeat until><( <{ timer }> <=> 10 )>
<move( 10 )steps>
<turn cw( 15 )degrees>
<end>

And for the timer:
<when I receive[ turn
<repeat( 10
<change{ timer }by( 1
<wait( 1 )secs>
<end>


Like The Big Bang Theory?  Like to play Secret Agent Laser Obstacle Chess?
http://www.johnoriordan.ie/wp-content/uploads/2009/04/hypnotoad.gif All glory to the Hypno-Toad.

Offline

 

#3 2010-04-12 04:32:16

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

Re: repeat for [] seconds block!

Or, we can use the built-in timer

[blocks]
<when I receive[ turn
<set{ Now }to( <timer>
<repeat until><(   <timer> <>>   (( <{ Now }> <+> 10 )) )
   <move( 10 )steps>
   <turn cw( 15 )degrees>
<end>
[/blocks]


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

Offline

 

#4 2010-04-12 04:34:38

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: repeat for [] seconds block!

Yeah... the timer is more accurate than the wait block.  smile


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

Board footer