Flint Particle System Forum - Plane contrail 2013-08-31T15:08:39+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher Plane contrail http://flintparticles.org/forum/comments.php?DiscussionID=565&Focus=1929#Comment_1929 2012-05-14T15:02:10+01:00 2012-05-15T08:41:14+01:00 Wolv3r http://flintparticles.org/forum/account.php?u=613 Hello, I'm working on a game with a plane and I try to use the particle system to generate a contrail of a plane when it boosts up. this is my Class: package particle { import ...
I'm working on a game with a plane and I try to use the particle system to generate a contrail of a plane when it boosts up.


this is my Class:

package particle {

import org.flintparticles.twoD.emitters.Emitter2D;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.zones.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.displayObjects.*;
import org.flintparticles.twoD.activities.FollowDisplayObject;
import flash.geom.Point;
import flash.display.DisplayObject;

public class BoostEmitter extends Emitter2D {

public function BoostEmitter(plane, renderer) {

this.counter = new ZeroCounter();

this.addInitializer(new Lifetime(1,1));
this.addInitializer(new Position(new LineZone(new Point(0, 0), new Point(-200, 0))));
this.addInitializer(new ImageClass( Line, [10] ));

this.addAction(new RotateToDirection());
this.addAction(new Age());
this.addAction(new Move());
this.addAction(new Fade(0.8, 0));

this.addActivity(new FollowDisplayObject(plane, renderer));
}

public function startEffect() {
this.counter = new Steady(24);
}

public function stopEffect() {
this.counter = new ZeroCounter();
}
}
}

This is my extended emitter class.

And this my renderer:

private var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
private var boostemitter:BoostEmitter;

private function InitEmitter(plane) {
this.addChild(renderer);
boostemitter = new BoostEmitter(plane, renderer);
renderer.addEmitter(boostemitter);
boostemitter.start();
}

My problem right now:

The RotateToDirection() doesn't work. When my plane flies upwards in an angle of 40° the created particles will have an angle of 0° but they move in the 40° direction.]]>
Plane contrail http://flintparticles.org/forum/comments.php?DiscussionID=565&Focus=1930#Comment_1930 2012-05-18T07:45:34+01:00 2012-05-18T08:09:10+01:00 Wolv3r http://flintparticles.org/forum/account.php?u=613 I tried the "Rotate()" function and it works now. But now I got a new problem: How can I add a filter to the Renderer when it's a DisplayObjectRenderer? I need to get the tail effect on my ...
But I can not use the BitmapRenderer cause the Game is like a SideScroller with infinity width and height. Or is there a way to increase width and height of the renderer in realtime?]]>
Plane contrail http://flintparticles.org/forum/comments.php?DiscussionID=565&Focus=1971#Comment_1971 2012-10-29T07:52:24+00:00 2012-10-29T07:52:35+00:00 Richard http://flintparticles.org/forum/account.php?u=1 You can resize the BitmapRenderer by setting its canvas property. However, currently this simply throws away the old canvas and creates a new blank one. If you need to retain the image from the ...