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

#1 2013-03-18 17:04:46

Bossdaddycam
New Scratcher
Registered: 2013-03-18
Posts: 1

Space invaders help!

Wondering if anyone knows how to make the enemy laser go to a random sprite besides my ship? Like i have 3 rows of enemies and i want the laser to go to a random one and shoot down at me.

Offline

 

#2 2013-03-19 08:30:38

dusty22
Scratcher
Registered: 2012-09-28
Posts: 49

Re: Space invaders help!

Just add a random operator in the script that tells the laser where to go.

Like:
Set Lasertarget [(Pick Random <1> to <2>)]
If Lasertarget = 1
   Glide to X sad X of Playersprite) Y sad Y of Playersprite)
End If
If Lasertarget = 2
   Glide to X:(Pick Random <-250> to <250>) Y:(Pick Random <-150> to <150>)
End If

Make sense?

Offline

 

Board footer