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

#1 2012-07-21 18:34:56

Kajunkat
Scratcher
Registered: 2012-06-30
Posts: 37

Help Please!

I want to make a sprite go to a random spot I already made. But I dunno how....help?

Offline

 

#2 2012-07-21 18:38:19

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Help Please!

You shouldn't have "kaj" in your username... To go to a random spot use the

 (pick random (-240) to (240)) 
block with the goto block


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-07-21 18:48:18

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Help Please!

If you want it to pick a random spot from a set of x/y values, put the coordinates in two lists ("x coordinates" and "y coordinates") and use this:

set [r v] to (pick random (1) to (length of [x coordinates v]))
go to x:(item (r) of [x coordinates v]) y:(item (r) of [y coordinates v])


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#4 2012-07-21 18:59:10

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Help Please!

zammer990 wrote:

You shouldn't have "kaj" in your username...

I dont think there is any relation.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

Board footer