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

#1 2010-05-31 05:49:45

jakuro
Scratcher
Registered: 2009-08-08
Posts: 10

random fire

how do i make an npc sprite fire something at random?

please help.

Offline

 

#2 2010-05-31 06:01:25

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: random fire

Hmm... perhaps try something like:
[blocks]
<when green flag clicked>
<forever>
<go to[ Sprite that you want to fire from
<turn cw( <pick random( -10 )to( 10 )degrees>
<repeat until><touching color[ colour of sprite (make sure the stage has a border of this colour)
<move( 5 )steps> This can be changed to speed up/slow down the missile
<end>
<end>
[/blocks]
Hope this helps!  smile  Also, I'm moving this to "All About Scratch" - just to let you know how it got here  wink


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

Board footer