I was trying to animate a sprite only once but it is animated twice can any one help me with this?? Here is the code
CuttingLineEffect(float x, float y, TiledTextureRegion line_region)
{
super(x, y, line_region);
this.animate(60, 1);
this.mPhysicsHandler = new PhysicsHandler(this);
this.registerUpdateHandler(this.mPhysicsHandler);
this.setPosition(x-this.getWidth()/2-50+this.getWidth()/2,y+50);
}
@Override
protected void onManagedUpdate(float pSecondsElapsed) {
if(!set)
{
MainMenu.LineList.add(this);
set = true;
}
if(!this.isAnimationRunning() && !time_to_unload)
{
time_to_unload = true;
}
super.onManagedUpdate(pSecondsElapsed);
};
The Animate() second parameter is how many times you want to loop that animation. because you only want to animate it once you might aswell use.