public function makeClient(PositionX:Float, PositionY:Float):Void
{
var client:Client = cast(_clients.getFirstAvailable(Client), Client);
//if there is any !exists revive
if(client != null){
cast(client, Client).reset(PositionX, PositionY);
}
}
and in client class the reset and kiil function is:
//Reset function, set defaults values
override public function reset(X:Float, Y:Float):Void
{
alpha = 0.0;
acceleration.x = acceleration.y = 0;
super.reset(X, Y);
//tween to alpha 1.0
FlxTween.tween(this, { alpha:1.0 }, .66, {ease:FlxEase.circOut, complete:function(tween:FlxTween):Void{
velocity.x = 30;
}} );
}
override public function kill():Void
{
if (!alive) return;
alive = false;
FlxTween.tween(this, { alpha:0 }, .66, {ease:FlxEase.circOut, complete:function finishKill(tween:FlxTween):Void{
exists = false;
} } );
}
Thanks for help me!!!