Flint Particle System Forum - Plane contrail Sat, 31 Aug 2013 15:17:20 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Plane contrail http://flintparticles.org/forum/comments.php?DiscussionID=565&Focus=1929#Comment_1929 http://flintparticles.org/forum/comments.php?DiscussionID=565&Focus=1929#Comment_1929 Mon, 14 May 2012 15:02:10 +0100 Wolv3r
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 http://flintparticles.org/forum/comments.php?DiscussionID=565&Focus=1930#Comment_1930 Fri, 18 May 2012 07:45:34 +0100 Wolv3r
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 http://flintparticles.org/forum/comments.php?DiscussionID=565&Focus=1971#Comment_1971 Mon, 29 Oct 2012 07:52:24 +0000 Richard