O
OwlTea
Guest
I feel like I should've solved this a long time ago but nothing seems to be working. Basically I have a two-frame attack animation that I want to play when the attack key is pressed and then the sprite goes back to it's one-frame idle pose.
What I've got is:
if(key_attack){
image_speed = .2; (not set in stone but just for testing purposes)
sprite_index = spr_partner_attack_1;
}
else{
sprite_index = spr_partner_idle_front;
}
But it seems like image_speed doesn't work properly with this code (and I checked, there's no other assignment of image_speed). The closest I can get it to behave is changing it to this:
if(key_attack){
image_speed = .2;
sprite_index = spr_partner_attack_1;
}
if(sprite_index = spr_partner_attack_1 && image_index >= 1.8){
sprite_index = spr_partner_idle_front;
}
But it still acts up and doesn't always play the full animation. I've been stuck on this stupid problem for days, can someone please tell me what I'm doing wrong so I can move on?
What I've got is:
if(key_attack){
image_speed = .2; (not set in stone but just for testing purposes)
sprite_index = spr_partner_attack_1;
}
else{
sprite_index = spr_partner_idle_front;
}
But it seems like image_speed doesn't work properly with this code (and I checked, there's no other assignment of image_speed). The closest I can get it to behave is changing it to this:
if(key_attack){
image_speed = .2;
sprite_index = spr_partner_attack_1;
}
if(sprite_index = spr_partner_attack_1 && image_index >= 1.8){
sprite_index = spr_partner_idle_front;
}
But it still acts up and doesn't always play the full animation. I've been stuck on this stupid problem for days, can someone please tell me what I'm doing wrong so I can move on?