Primary tabs

Comments by User

Tuesday, December 31, 2019 - 06:31

insert new variable called "a".




step will be:


if a=0 {

       if health>=50 then {exit;// if needed magic_shield_activation=false;}

   a=1;//this is the key
     // _____ here create that casting effect; ____ magic_shield_activation=true;   


 "a" is crucial variable to block future effect.


//if health is recovered a=0 is again.

if health>=50{a=0;magic_shield_activation=false;}


all of this actually depends how that ship react in various situations, and code optimization with command "else" or use switch() command with plenty of breaks;

Don`t use many "if" per step, it is bad.

P.S ..don`t forget to destroy animation object  at shield animation end ..

in case that animation is a part of that character then you need additional timer variable.