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

#1 2012-09-01 19:26:04

JakJones
New Scratcher
Registered: 2012-08-22
Posts: 5

Boss Script

I am trying to make a boss that looks like the Narada from Star Trek. It has lasers, torpedos and a EMp as weapons.

Does anyone know how to code a boss so that it does those attacks randomly?

Also, can anyone give me the costumes for these weapons?

Offline

 

#2 2012-09-02 04:31:45

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Boss Script

repeat until <(boss health) = (0)>
wait (pick random (0.5) to (2)) secs
set [attack v] to (pick random (1) to (3))
if <(attack) = (1)>
broadcast [emp v]
else
if <(attack) = (2)>
broadcast [laser v]
else
broadcast [torpedos v] 
end
end
Note: This gives each option an equal chance of occurring. If you want some attacks to be more common than others then you can create a percentage method.

Does this help with the random attacks?

Last edited by Prestige (2012-09-02 04:33:11)


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

Board footer