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

#1 2012-03-08 17:58:45

nathanh123
Scratcher
Registered: 2012-02-17
Posts: 11

Emitter

Hey again, im looking for a bit of advice on how to create an emitter. i am trying to make a gun that can have more than one bullet in view at the same time coming from the gun. so rather than firing and having to wait until the bullet disapears before firing again, i would like to have a script that creates a bullet, then destroyes it's self when it hits the target.....  does this make sense to you??
please help  smile

Offline

 

#2 2012-03-08 18:27:46

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Emitter

Make multiple bullets. Have a variable in each that has an ID. Have a list called current IDs. When you fire, add an ID to the list. When it hits a target, remove the ID.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#3 2012-03-08 22:38:31

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Emitter

You can't create sprites with scripts.  Cloning is something that (I believe) will be in Scratch 2.0, but, until then, bobbybee is right, one of the only ways to have multiple bullets is to have multiple sprites (the other way is to stamp all the bullets with one sprite, but this is probably more trouble than it is worth)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer