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

#1 2011-12-30 10:28:57

Ritasstudent
Scratcher
Registered: 2011-12-10
Posts: 36

How do you make a sprite go to random places after it is clicked?

I need to know how, after the sprite is clicked, to make it go to random places. Thanks!


http://i46.tinypic.com/1z2fy2g.gif

Offline

 

#2 2011-12-30 12:21:25

Kileymeister_test
Scratcher
Registered: 2010-01-31
Posts: 100+

Re: How do you make a sprite go to random places after it is clicked?

This basic script will put your sprite on a random point on the stage.
http://img832.imageshack.us/img832/6850/script.gif

Or if you want it to only go to certain predetermined places, use a script like this:
http://img441.imageshack.us/img441/5830/scriptx.gif
Just enter in theX and Y coordinates for where you want the sprite to be into the X and Y lists respectively.

Er, the images don't appear to be working.  I'll try to figure out what's wrong with them.

Last edited by Kileymeister_test (2011-12-30 14:41:15)


Kileymeister's test account.  I upload engines and demos and stuff for public use.
Currently Working on: Grapple Arms!

Offline

 

#3 2011-12-30 12:32:32

xGluttony
Scratcher
Registered: 2011-05-03
Posts: 25

Re: How do you make a sprite go to random places after it is clicked?

<when[ Sprite ]clicked>
<go to x sad  <pick random(-200)to(200)y: ( <pick random(-200)to(200


Hope it works

Last edited by xGluttony (2011-12-30 12:33:23)


http://i55.tinypic.com/2mcx6x5_th.jpg

Offline

 

#4 2011-12-30 14:18:08

luiysia
Scratcher
Registered: 2011-07-05
Posts: 1000+

Re: How do you make a sprite go to random places after it is clicked?

Same as above, but if you want the whole screen as a range, it's
go to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))


http://i50.tinypic.com/dx00pd.gif

Offline

 

#5 2011-12-30 14:39:26

rabbit1131
Scratcher
Registered: 2009-10-16
Posts: 1000+

Re: How do you make a sprite go to random places after it is clicked?

Kileymeister_test wrote:

This basic script will put your sprite on a random point on the stage.
http://img832.imageshack.us/img832/6850/script.gif

Or if you want it to only go to certain predetermined places, use a script like this:
http://img441.imageshack.us/img441/5830/scriptx.gif
Just enter in theX and Y coordinates for where you want the sprite to be into the X and Y lists respectively.

Er, the images don't appear to be working.  I'll try to figure out what's wrong with them.

Images are disabled.


The Intergalactic Adventures of Revesilia! I hope you will partake in this gigantic undertaking, to build the sequel to the hit map The Adventures of Revesilia! The Intergalactic Adventures of Revesilia Map Builders Application thread! http://internetometer.com/image/35004.png

Offline

 

#6 2011-12-30 14:41:44

Kileymeister_test
Scratcher
Registered: 2010-01-31
Posts: 100+

Re: How do you make a sprite go to random places after it is clicked?

rabbit1131 wrote:

Kileymeister_test wrote:

This basic script will put your sprite on a random point on the stage.
http://img832.imageshack.us/img832/6850/script.gif

Or if you want it to only go to certain predetermined places, use a script like this:
http://img441.imageshack.us/img441/5830/scriptx.gif
Just enter in theX and Y coordinates for where you want the sprite to be into the X and Y lists respectively.

Er, the images don't appear to be working.  I'll try to figure out what's wrong with them.

Images are disabled.

Oh ok, I'll put them in url tags instead so Rita can click on them.


Kileymeister's test account.  I upload engines and demos and stuff for public use.
Currently Working on: Grapple Arms!

Offline

 

#7 2011-12-30 14:45:56

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How do you make a sprite go to random places after it is clicked?

I can't post the images, because of the stupid troll attack, so I'll just give you the link:
http://i42.tinypic.com/28utwde.png


Why

Offline

 

#8 2011-12-31 10:12:27

Ritasstudent
Scratcher
Registered: 2011-12-10
Posts: 36

Re: How do you make a sprite go to random places after it is clicked?

Thanks everyone!


http://i46.tinypic.com/1z2fy2g.gif

Offline

 

#9 2011-12-31 10:25:49

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How do you make a sprite go to random places after it is clicked?

No problem  smile


Why

Offline

 

Board footer