G
gangkoso22
Guest
Hello all,
I'm still a noob and I'm posting here to get some help.
I#m using a sprite which has a total of 24 images, with 6 images facing each 4 directions.
What I'm trying to achieve is so that the sprite only facing downward, only playing the idle animation facing downward.
The problem is, the sprite plays the whole animation.
If I put image_index = 18; in the step event, the sprite does face downward but doesn't play the next animation.
So i came up with this.
Any help would be very appreciated.
Thank you.
I'm still a noob and I'm posting here to get some help.
I#m using a sprite which has a total of 24 images, with 6 images facing each 4 directions.
What I'm trying to achieve is so that the sprite only facing downward, only playing the idle animation facing downward.
The problem is, the sprite plays the whole animation.
If I put image_index = 18; in the step event, the sprite does face downward but doesn't play the next animation.
So i came up with this.
GML:
currFrame = 0;
image_index = currFrame;
startFrame = 18;
maxFrame = sprite_get_number(sNPC_Josh);
image_speed = 0.2;
GML:
if (currFrame == 0)
{
currFrame += startFrame
while (currFrame <= maxFrame)
{
currFrame += 1;
}
}
else
{
currFrame = startFrame;
}
Thank you.