I'm trying to create a tail for a sprite that is moving on the screen.
I need something like this: How to add trail path for moving sprite in andengine
Unfortunally, the one asking the question didn't explain how he succeded in creating the tail (even if "dotted").What I'm able to do is create a tail that resided in the emitting sprite, but when I rotate the sprite, also the tail rotates creating an artificial effect that is not nice at all.
So I'd like to have a tail that once is "emitted" remains still respecting the sccene.
This works for me:
PointParticleEmitter emitter = new PointParticleEmitter(240, 400){
public void onUpdate(final float pSecondsElapsed){
super.onUpdate(pSecondsElapsed);
setCenterX(star.getX());
}
};
SpriteParticleSystem spritePS = new SpriteParticleSystem(emitter, 1, 5, 50, starTR, getVertexBufferObjectManager());
spritePS.addParticleInitializer(new ScaleParticleInitializer<Sprite>(0.5f));
spritePS.addParticleInitializer(new VelocityParticleInitializer<Sprite>(-10, 10, 100, 200));
spritePS.addParticleInitializer(new AccelerationParticleInitializer<Sprite>(0f, 50f));
spritePS.addParticleInitializer(new RotationParticleInitializer<Sprite>(0f, 360f));
spritePS.addParticleInitializer(new ExpireParticleInitializer<Sprite>(1.0f, 15.0f));
spritePS.addParticleModifier(new RotationParticleModifier<Sprite>(0.0f, 15.0f, 0, 360));
scene.attachChild(spritePS);
star is a sprite I want to emit particles. When I drag it the particles do not move (except their own movement upwards)