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

#1 2010-09-07 19:34:28

seven75
New Scratcher
Registered: 2010-09-07
Posts: 1

Randomizing sprites...

I was wondering if someone could tell me if it is possible to do this kind of function with Scratch. I have a stage, which is a grid of 40 squares, I also have 40 sprites which are assigned to each space on the grid via (x  y) coordinates. I would like to be able to click the Green Flag control and have "10" out of the 40 sprites Randomly picked and placed within their respective places on the grid. Possible or not possible?   Thank You for info.

Offline

 

#2 2010-09-08 01:50:37

wei2912
Scratcher
Registered: 2010-05-09
Posts: 100+

Re: Randomizing sprites...

Possible. But it is quite complicated. Here's the code:

http://img529.imageshack.us/img529/8015/1stsprite.th.gif
http://img715.imageshack.us/img715/4185/2ndsprite.th.gif
http://img189.imageshack.us/img189/3502/3rdsprite.th.gif

The number of the next broadcast is on the current sprite + 1. The sprite should receive the number of it's own self.

Last edited by wei2912 (2010-09-08 01:59:56)


Waiting for Scratch 2.0...

Offline

 

Board footer