pixeltroid
Member
I'm trying to sync an enemy's attack projectile with it's attack animation. Basically, when the enemy sprite is playing, I want to create the projectile exactly on the 4th image of the sprite animation.
Here's what I've tried:
This is in the enemy's step event...
This code only plays the animation, but doesn't create the enemy projectile (obj_enemyfireball3).
If I take out "if image_index...", the projectile is created but is out of sync with the animation.
How do I make it so that the projectile is launched exactly after the 4th frame in the animation?
Any help would be appreciated!
Here's what I've tried:
This is in the enemy's step event...
Code:
if (alarm[0] < 0) {
sprite_index = spr_attack
if (image_index = 4)
{
att = instance_create(x,y,obj_enemyfireball3);
att.speed = 3;
}
alarm[0] = 90
}
If I take out "if image_index...", the projectile is created but is out of sync with the animation.
How do I make it so that the projectile is launched exactly after the 4th frame in the animation?
Any help would be appreciated!