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

#1 2008-12-08 01:50:10

funymoose
Scratcher
Registered: 2008-12-08
Posts: 2

Randomize sprites?

Iḿ basically just starting out on scratch and have made a very simple game which i am working on to get perfected. so i was wondering if anybody could give me instructions on how to set the sprites to start in a random position each time.
also if anybody could tell me how to:
add a score eg; 1/3, 2/3
set one sprite to broadcast a message to make the other sprites move away from it

Thanks

Offline

 

#2 2008-12-08 04:06:08

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Randomize sprites?

In the numbers blocks, there is a "random () () block"

Put int the lowest and highest number you want to generate.  If you put a pair of these into a "goto x: y:" block that sprite will go to a random location.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2008-12-08 04:56:34

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Randomize sprites?

To make sprites move away from another sprite, send them a Broadcast Message.  When they receive the message, you can have them Point towards the sprite you want them to run away from and them use the Move command to go a negative number of steps.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2008-12-08 05:40:14

funymoose
Scratcher
Registered: 2008-12-08
Posts: 2

Re: Randomize sprites?

Thanks you two thats really helped me loads  smile

Offline

 

Board footer