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

#1 2008-06-24 14:40:40

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

How Do you make a sprite move randomly across screen?

Hi! I just need to know how to make an "enemy" sprite move randomly across the screen so that if you run into it you lose a life and your score is reset.I know how to do the stuff with the variables for score and lives though. Thanks  smile

Offline

 

#2 2008-06-24 14:50:33

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

Re: How Do you make a sprite move randomly across screen?

Try the move 10 steps if on edge bounce sequence


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-06-24 15:08:49

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: How Do you make a sprite move randomly across screen?

Sorry new at scratch keep forgetting, what blocks are those?

Offline

 

#4 2008-06-24 15:09:31

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

Re: How Do you make a sprite move randomly across screen?

[blocks]<forever>[/blocks]
[blocks]<move( 10  )steps>[/blocks]
[blocks]<if on edge, bounce>[/blocks]
[blocks]<end>[/blocks]

Last edited by Bluestribute (2008-06-24 15:10:03)


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

 

#5 2008-06-24 15:11:19

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: How Do you make a sprite move randomly across screen?

Thanks!!!

Offline

 

#6 2008-06-24 15:24:49

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: How Do you make a sprite move randomly across screen?

Wait, what about moving up and down?
Change y by doesn't work if you put a if on edge bounce block after it.

Offline

 

#7 2008-06-24 15:27:43

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

Re: How Do you make a sprite move randomly across screen?

[blocks]<forever>[/blocks]
[blocks]<move( 10  )steps>[/blocks]
[blocks]<<turn cw( <pick random( negatives  )to( positives  )degrees>[/blocks]*
[blocks]<if on edge, bounce>[/blocks]
[blocks]<end>[/blocks]

*Replace negatives with a negative number and positives with a positive number


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

 

#8 2008-06-24 15:31:04

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: How Do you make a sprite move randomly across screen?

Thanks Again!!
Lol, my sprite looks like a drunk now.

Last edited by AlanProjects (2008-06-24 15:34:52)

Offline

 

#9 2008-06-24 15:35:41

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

Re: How Do you make a sprite move randomly across screen?

AlanProjects wrote:

Thanks Again!!
Lol, my sprite looks like a drunk now.

Haha, gotta lay off those beers  smile


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

 

#10 2008-06-24 15:51:34

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: How Do you make a sprite move randomly across screen?

BTW http://scratch.mit.edu/projects/AlanProjects/196692 the game I made!

Offline

 

Board footer