Looping Specific Frames In Sprite

A

Anomaly

Guest
I've been trying to check the frame number that my animation is on and if it's say, frame 15 (out of 30)
Then loop back to frame 3 and continue looping 3-15 until another variable is changed.

No luck.
Anyone know a snappy work around to this?

Thanks!
 

Jakylgamer

Member
make a few variables
CREATE EVENT:
Code:
ani_state = 0;
ani_start = 0;
ani_end = 0;
ani_speed = 0;
then make a script : im going to name it action_loop
SCRIPT:
Code:
///action_loop()
///@param ani_state
///@param ani_speed
///@param ani_start
///@param ani_end

image_index = ani_start; //set image index to ani_start

if ani_state!=argument[0] {
    //set up the base animation and state
    ani_state=argument[0];
    ani_start=argument[2];
    ani_end = argument[3];
 
}

ani_speed = argument[1]; //set animation speed
ani_end = argument[3]+ani_speed; //set animation end + the image speed
 
if ani_start <= ani_end {
    ani_start += ani_speed; //do animation
} else {
    ani_start = argument[2]; // reset animation
}



This may need some tweaking :)
 
Last edited:
A

Anomaly

Guest
cool but do you know a quick and easy way to make a "landing animation" when a player lands from a jump and it blends seamlessly into his running or standing animation?

hmmmmm???

heheh.;)
 
Top