T
Tchangla
Guest
I'm trying that at a certain point of the code trigger an animation of an attack.
In the draw code, i have this
and in the step, this
But the animations seems to go too fast and don't show on screen. Are better ways out there to trigger an animation from code? (ah, also I need that until the animation isn't done, the following code isn't executed).
In the draw code, i have this
Code:
if(batAnimationOn==1){
draw_sprite( attack, batAnimation,42, 80);
}
Code:
if(arrayTurn>=3 && arrayTurn<=5){
if(random(1) > 0.5){target=2}else{target=1}
damage=battle_stats[arrayTurn,10]-battle_stats[target,12];
if(damage<=0){damage=0;}
battle_stats[target,4]-=damage;
batAnimationOn=1;
{
var i;
for (i = 0; i < 4; i += 1)
{
batAnimation=i;
}
}
batAnimationOn=0;
showDamage=1;
doAction=0;