# LibBDX create a tail when the object is moved

I am looking for a way to implement in my game a kind of shadow/tail which will be displayed after the object is moved. Should I use animation? If yes how? Here an example:

• usually you use some ParticleEmitters. LibGDX already has one. – Benedikt S. Vogler May 13 '15 at 10:14
• @BenediktS.Vogler Thank you so much! I didn't know it! – user65825 May 13 '15 at 17:03

I used ParticleEditor to create this:

This is the code:

package com.gamefromscratch;

public class Particles extends ApplicationAdapter {
SpriteBatch batch;
ParticleEffect pe;

@Override
public void create () {
batch = new SpriteBatch();

pe = new ParticleEffect();
pe.getEmitters().first().setPosition(Gdx.graphics.getWidth()/2,Gdx.graphics.getHeight()/2);
pe.start();
}

@Override
public void render () {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

pe.update(Gdx.graphics.getDeltaTime());
batch.begin();
pe.draw(batch);
batch.end();
if (pe.isComplete())
pe.reset();
}
}


This is a basic fire that can be used (for example) in any car, simulating turbo. You can edit create something more specific with the ParticleEditor.