How to setRotation on a Emitter?[Solved]


(matt nesbary) #1

From what I understand, particle emitters shoot out little dots very fast mostly… Is it possible set up an emitter that slooowly shoots particles for an explosion effect… like () ( ) (( )) 3 frames in one sprite map, the emmitter would shoot maybe 2 or 3 of those then stop.

  1. can the particle emitter rotate sprites? I kind of wanted it to shoot lines out … I have a laser and want lines of light to shoot when it hits.

entity animations have “hit”, [9, 10, 11, 12], 18, false); speed, stop animation) code at the end but emitters don’t. Now that I think about it I could just spawn an entity lol… I’d still like to know if emitters can be made to do more than just shoot dots really fast tho :smile:


(Zachary Lewis) #2

The emitter emits one particle whenever you call emit(). Feel free to call emit() as often as you’d like.


(matt nesbary) #3

I was using this code

  public static function particleExplosion6(_x:Number, _y:Number):void
	{
		for (var i:int = 0; i < 11; i++)
		{
			explode6.emit("explosion6", _x, _y)
		}
	}

from a tutorial or something,… I see that if I take out the for (var i:int = 0; i < 11; i++) it just shoots 1 particle or I can lower i <11 to something like i < 2 and it emits less particles.

What I’m trying to do is like… shoot a laser and when it hits shoot out a bunch of little lines… ---------- ( ) – – but going off at angles… I think to do that I’d need to have it rotate the images according to the angle they are shot at… but that might be too complicated…

my other solution is to just have 1 explosion 1 particle… and draw angled lines in the image …it’s kinda working out… I’m going to try to make something that looks better though


(matt nesbary) #4

setRotation is what I need to do I think… does anyone have an example of how to put this in an emitter? I tried some variations of this:

explode8 = new Emitter(spr_explosion8, 20, 20);
explode8.newType(“explosion8”, [0, 1, 2, 3, 4, 5, 6, 7, 8 ] ); explode8.setMotion(“explosion8”, 270, 1, 0.1, 90, 32, 0.5); explode8.setRotation(“explosion8”, 300, 60, 0, 30, false, null);

but no luck … … I’m also wondering if anyone uses setColor … like could you have 1 emitter and change its color when you call it? im currently using a new emitter for everything.