Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthorericr
- CommentTimeApr 11th 2008 edited
If you have moved the Emitter around withing the Renderer object then you must specify this offset in the DeathZone constructor. If you move the Emitter after setting the DeathZone does not also move the DeathZone: it must be manually moved the same amount.
Moving the Emitter's renderer works as expected.
Tested against the DiscZone object. "new Point( 0, 0 );" as the point value resulted in the DeathZone appearing in the top-left corner of the Renderer object.
Test code:package
{
import flash.display.Sprite;
import flash.geom.Point;
import org.flintparticles.actions.DeathZone;
import org.flintparticles.actions.Move;
import org.flintparticles.counters.Steady;
import org.flintparticles.displayObjects.Dot;
import org.flintparticles.emitters.Emitter;
import org.flintparticles.initializers.*;
import org.flintparticles.renderers.BitmapRenderer;
import org.flintparticles.zones.*;
[SWF(width='500', height='500', frameRate='61', backgroundColor='#000000')]
public class Test extends Sprite
{
public function Test()
{
var emitter : Emitter = new Emitter( );
var renderer : BitmapRenderer = new BitmapRenderer();
emitter.renderer = renderer;
addChild( renderer );
renderer.x = 50; // To see the offset problem.
emitter.x = 125;
emitter.y = 125;
emitter.counter = new Steady( 25 );
emitter.addInitializer( new SharedImage( new Dot( 3 ) ) );
emitter.addInitializer( new Position( new PointZone( new Point( 0, 0 ) ) ) );
emitter.addInitializer( new Velocity( new DiscZone( new Point( 0, 0 ), 100, 0 ) ) );
// Set the DiscZone to use "new Point( 0, 0 )" to see the issue.
emitter.addAction( new DeathZone( new DiscZone( new Point( emitter.x, emitter.y ), 110, 95 ) ) );
emitter.addAction( new Move( ) );
emitter.start( );
}
}
}
Thoughts? Is that how DeathZones are intended to work? The Initializers respect the emitter.x and emitter.y settings but the DeathZone appears not to... :/ -
- CommentAuthorRichard
- CommentTimeApr 11th 2008 edited
This is how the DeathZones are intended to work. The zones are in the same coordinate space as the particles.
1 to 2 of 2
