Nuclear Detergent
Member
I'm trying to make a jump and falling animation, with animated sprites. I want both of them to stop on the last frame (image_speed = 0), and continue from the first frame, when the jump-button is pressed again.
It works fine during the jump animation. It stops on the last frame, and continues from the first once the jump button is pressed again. However, the falling animation is stuck on the last frame from the get go. I don't understand why, as the approach works for the jumping animation. Any help would be appreciated.
(I'm awate that there's some excess use of "image_speed = 1")
Code:
//animation
STEP EVENT
if(!grounded=1) {
image_speed = 1;
if (sign(vsp) > 0) {
image_speed = 1;
sprite_index = sPlayerF;
}
else sprite_index =sPlayerA;
if sprite_index = sPlayerA {
image_speed = 1;
if image_index > image_number - 1 {image_speed = 0};
};
if sprite_index = sPlayerF {
image_speed = 1;
if image_index > image_number - 1 {image_speed = 0};
};
}
else {
image_speed=1;
if (hsp==0) {
sprite_index = sPlayer;
}
else {
sprite_index = sPlayerR;
}
}
(I'm awate that there's some excess use of "image_speed = 1")