J
Jax_the_grey_cat
Guest
Hello, first congrats on the new forums!
I've been having a little trouble with switching sprites maybe you guys can help me out.
This is my code for this action in particular
sorry for the unclean code, it's the best I can do so far.
My problem comes when switching from the "sprOrcScoutDown" sprite to the "sprOrcScoutAttackDown" sprite, when it switches it doesn't start from the subimage 0 of the sprOrcScoutAttackDown sprite, it starts from a random subimage.
If anyone could give me a tip on how to solve this I would really appreciate it.
Thank you very much!
I've been having a little trouble with switching sprites maybe you guys can help me out.
This is my code for this action in particular
if canattack = true and instance_exists(objPlayer)
{
if distance_to_object(objPlayer)<12
{
if sprite_index = sprOrcScoutDown
{
sprite_index = sprOrcScoutAttackDown;
image_speed = 0.2;
attacking = true;
{
if (image_index > 10.8 && image_index <= 11.2)
{
canattack = false;
sprite_index = sprOrcScoutDown;
attacking = false;
alarm[0]=90;
}
}
}
}
}
{
if distance_to_object(objPlayer)<12
{
if sprite_index = sprOrcScoutDown
{
sprite_index = sprOrcScoutAttackDown;
image_speed = 0.2;
attacking = true;
{
if (image_index > 10.8 && image_index <= 11.2)
{
canattack = false;
sprite_index = sprOrcScoutDown;
attacking = false;
alarm[0]=90;
}
}
}
}
}
sorry for the unclean code, it's the best I can do so far.
My problem comes when switching from the "sprOrcScoutDown" sprite to the "sprOrcScoutAttackDown" sprite, when it switches it doesn't start from the subimage 0 of the sprOrcScoutAttackDown sprite, it starts from a random subimage.
If anyone could give me a tip on how to solve this I would really appreciate it.
Thank you very much!