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

#1 2010-02-28 18:22:41

howlcall
Scratcher
Registered: 2010-02-23
Posts: 24

picking at random

okay, so I can't figure out how to get it to pick a costume at random and then wait until the other sprite matchs it, and THEN pick another random costume... I just can't seem to get it to work... any help?

Offline

 

#2 2010-02-28 18:31:53

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: picking at random

Say you have 10 costumes.

Code:

[when flag clicked]
[forever]
[][switch to costume (pick random (1) to (10))]
[][wait until <([costume#] of [other sprite]) = (costume#)>]
[end of forever]

Last edited by The-Whiz (2010-02-28 18:32:07)

Offline

 

#3 2010-02-28 19:26:42

howlcall
Scratcher
Registered: 2010-02-23
Posts: 24

Re: picking at random

so, I'd put:
[blocks]
<when green flag clicked>
<forever>
<switch to costume[ <pick random( 2 )to( 33
<wait until>([costume#] of [other sprite]) = (costume#)
<end>
[/blocks]

Offline

 

#4 2010-02-28 19:27:44

howlcall
Scratcher
Registered: 2010-02-23
Posts: 24

Re: picking at random

I don't understand the third line... with [costume#} ....

Offline

 

Board footer