Fangames > Programming Questions

Animation looping bug [YoYoYo engine]

(1/1)

MirrorDrill:
So I've coded a few custom player animations into YoYoYo's GMS engine, but I encountered a weird bug.
What I want to make is a double jump animation, that plays once on the second jump press in the air.
However, for some reason the animation which has 9 frames

* at the start stays on the first frame for 3 loops
* loops back to the 1st frame after only the fifthDoes anyone have any idea of what could be causing this?
I set global.playerAnimationFix to true.
Here are the relevant snippets

scrJump:
(click to show/hide)
--- Code: ---...
    if (!place_meeting(x,y+(global.grav),objWater3))
    {
        djumped = true;
        djump = 0;  //take away the player's double jump
        ...

--- End code ---
End step:
(click to show/hide)
--- Code: ---...
        else    //in the air
        {
            if(djumped)
            {
                image_speed = 0.4;
                show_debug_message("djump"+string(image_index))
                sprite_index = sprPlayerDoubleJump;
                if(image_index > 8){
                    djumped = false;
                }
            }
            else if(...)
...

--- End code ---
Console output below.
(click to show/hide)
If it doesn't load

Navigation

[0] Message Index

Go to full version