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

#1 2009-06-26 14:16:14

CDromatron
Scratcher
Registered: 2009-02-09
Posts: 23

random stage, help!

Hi, I'm trying to make a game of luck where you go through a dungion and into rooms but how do I say
<when green flag clicked>
<forever> stage# = pick random 1 to 10
<end>

what I'm trying to say is I want a random stage to appear. please help me!

Offline

 

#2 2009-06-26 14:39:13

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: random stage, help!

You can only make a script like that in the stage's scripts area. The script would look like this:
http://www.freeimagehosting.net/uploads/fbd0d5ea3c.png


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#3 2009-07-01 17:24:03

greenflash
Scratcher
Registered: 2009-05-27
Posts: 1000+

Re: random stage, help!

But if you want to click on a sprite and have it happen, you need to do this

Sprite Script:
[blocks]
<when[  ]clicked> (or any other controll block)
<broadcast[ random room ]

Stage script:
<when I receive[  random room ]
<repeat until> something happens
<switch to background[<pick random( 1 )to( 10 ))
<end>


http://i48.tinypic.com/2wrkirk.pnghttp://i46.tinypic.com/6r5zk7.pnghttp://i45.tinypic.com/2vtxr1t.png

Offline

 

Board footer