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

#1 2013-01-21 17:17:28

AgentCNF
Scratcher
Registered: 2012-08-27
Posts: 21

How Can I Make A Script That Picks A Random Sprite??

I made a Bouncy ball Machine project, and I when you click it, I want it to choose a random ball and make it go to the door. If you know how to make a script that chooses a random sprite, PLEASE TELL ME!!!


Go St. Louis Cardinals!!! I Hate The Cubs!

Offline

 

#2 2013-01-21 17:53:40

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: How Can I Make A Script That Picks A Random Sprite??

when I receive [random ball v]
set [ball v] to (pick random [1] to [5]) //or the N° of balls you got
if <(ball) = [1]>
    broadcast [ball 1 v]
end
if <(ball) = [2]>
    broadcast [ball 2 v]
end
say [and so on]


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#3 2013-01-21 18:00:29

AgentCNF
Scratcher
Registered: 2012-08-27
Posts: 21

Re: How Can I Make A Script That Picks A Random Sprite??

technoguyx wrote:

when I receive [random ball v]
set [ball v] to (pick random [1] to [5]) //or the N° of balls you got
if <(ball) = [1]>
    broadcast [ball 1 v]
end
if <(ball) = [2]>
    broadcast [ball 2 v]
end
say [and so on]

Thanks!


Go St. Louis Cardinals!!! I Hate The Cubs!

Offline

 

Board footer