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

#1 2008-05-16 22:28:17

fillygal
Scratcher
Registered: 2008-04-28
Posts: 2

how do i make stuff move randomly around the screen

How can i make sprites just randmly moove around the screen like running mice?

Offline

 

#2 2008-05-16 22:38:57

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: how do i make stuff move randomly around the screen

[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<move(10 )steps>[/blocks]
[blocks]<if on edge, bounce>[/blocks]


That's one way that's simple. Another is:

[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<go to x sad <pick random( -250 )to( 250  )y sad  <pick random( -250 )to( 250[/blocks]
[blocks]<wait(.001 )secsc>[/blocks]


But that's more of appearing, but you could use glide instead of go to


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#3 2008-05-17 04:48:46

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

Re: how do i make stuff move randomly around the screen

If I can expand on what Bluestribute said...I would recommend trying the Glide block instead of the Go To block in the second method.  The Go To block will give you a really frantic motion effect, too fast to really see so it will appear as though the sprite is disappearing and then reappearing.  Maybe that is what you want, only you can say!  But the Glide block will move the sprite smoothly from point to point across the screen.  Try them both and see what looks best for your project.


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

Offline

 

#4 2008-05-17 04:52:27

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

Re: how do i make stuff move randomly around the screen

You can also put some random direction into the first method:

[blocks]
<when green flag clicked>
<forever>
<turn cw( <pick random( -10 )to( 10 )degrees>
<move( 5 )steps>
<if on edge, bounce>
<end>
[/blocks]


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

Offline

 

#5 2008-05-17 08:01:18

funkymonkey
Scratcher
Registered: 2007-06-03
Posts: 1000+

Re: how do i make stuff move randomly around the screen

Paddle2See wrote:

If I can expand on what Bluestribute said...I would recommend trying the Glide block instead of the Go To block in the second method.  The Go To block will give you a really frantic motion effect, too fast to really see so it will appear as though the sprite is disappearing and then reappearing.  Maybe that is what you want, only you can say!  But the Glide block will move the sprite smoothly from point to point across the screen.  Try them both and see what looks best for your project.

<when green flag clicked>
<forever>
<glide( 1 )secs to x sad  <pick random( -250 )to( 250 )y sad  <pick random( -250 )to( 250
<end>


http://i243.photobucket.com/albums/ff67/hprules_photos/banner2.jpg
Kuzimu: Dawn of a New Age                                                                                                  Coming May 2010

Offline

 

#6 2008-05-17 16:03:26

redsooty9
Scratcher
Registered: 2008-03-06
Posts: 69

Re: how do i make stuff move randomly around the screen

Just use the glide Block in Motion.


Redsooty9

Offline

 

Board footer