A
anthropus
Guest
I SOLVEDIT!
change this
to this
apparently image index returns a real number, not an integer
__________________________________
Hi all. Im using script-states (which are controlled by a switch statement) to control an object's sprites, behavior, etc, and all is pretty much working as I want it to atm, but im really struggling with making a sprite stop animating at a certain frame (subimage).
Basically, the last frame of a death animation has the character lying on the ground. So I want the death sprite animation to stop animating at that last frame [just to have a dead body laying there, which is later removed with an alarm with instance_destroy()]. But it seems no matter what code I try, the death sprite animation keeps looping (so the sprite and script-state are correct, but my "stop animation" code isnt working. Any help?
Here's the "Death" script-state
*the "hold last frame" part of the code is what is not working at all*
change this
Code:
//hold last frame
if (image_index==5)
{
image_speed=0;
}
Code:
//hold last frame
if (image_index>=5 &&& <6)
{
image_speed=0;
}
__________________________________
Hi all. Im using script-states (which are controlled by a switch statement) to control an object's sprites, behavior, etc, and all is pretty much working as I want it to atm, but im really struggling with making a sprite stop animating at a certain frame (subimage).
Basically, the last frame of a death animation has the character lying on the ground. So I want the death sprite animation to stop animating at that last frame [just to have a dead body laying there, which is later removed with an alarm with instance_destroy()]. But it seems no matter what code I try, the death sprite animation keeps looping (so the sprite and script-state are correct, but my "stop animation" code isnt working. Any help?
Here's the "Death" script-state
*the "hold last frame" part of the code is what is not working at all*
Code:
//set sprite
img_spd=.5;
sprite_index=sp_puny_death;
image_speed=img_spd;
//hold last frame
if (image_index==5)
{
image_speed=0;
}
//remove instance
if (alarm[1]=-1)
{
alarm[1]=2*room_speed;
}
scr_collision_enemy();
Last edited by a moderator: