L
Latch
Guest
I keep all my characters actions confined within one sprite, I then call upon them when needed, however, I have hit a slight hiccup that I can't quite fix.
For ease I have removed several cases and just stuck with one, each facing resembles the direction of the character, 4 is down:
This works as intended, when the player stands still it loops the resting animation, if they move, it transitions perfectly into the walking one and when punching, it transitions nicely into the punching one.
However, right when the cycle has ended for the punching animation the sprite flickers before transitioning into the resting animation.
I used the debug runner (With VERY limit knowledge of it) I double clicked on the line for the attacking animation and spammed the green play button as it cycled the punch animation. It worked fine and as soon as it ran that bit of code, it flickered, which leaves me to believe it has something to do with the resting animation loop.
But, with the fact the resting loop works flawlessly with the walking animation, I have no idea what has happened. Can anyone see anything?
For ease I have removed several cases and just stuck with one, each facing resembles the direction of the character, 4 is down:
Code:
if attacking = false
{
if moved = false//Standing still
{
image_speed = 0.1/2+0.05;//Have a slower animation speed when stood still
switch(facing)
{
case 4: if image_index >= 3 {image_index = 0;} if image_index < 0 {image_index = 0;} break
}
}
else if moved = true
{
image_speed = playerspeed/8;//The players sprites animate the faster or slower that he player moves
switch(facing)
{
case 4: if image_index >= 19 {image_index = 15;} if image_index < 15 {image_index = 15;} break
}
}
}
else //if attacking = true
{
image_speed = playerspeed/8;//The players sprites animate the faster or slower that he player moves
switch(facing)
{
case 4: if image_index >= 39 {image_index = 35; attacking = false;} if image_index < 35 {image_index = 35;} break
}
}
However, right when the cycle has ended for the punching animation the sprite flickers before transitioning into the resting animation.
I used the debug runner (With VERY limit knowledge of it) I double clicked on the line for the attacking animation and spammed the green play button as it cycled the punch animation. It worked fine and as soon as it ran that bit of code, it flickered, which leaves me to believe it has something to do with the resting animation loop.
But, with the fact the resting loop works flawlessly with the walking animation, I have no idea what has happened. Can anyone see anything?
Last edited by a moderator: