• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED stopping animation at the last frame

this is what my current code looks like:

if (image_index == 510)
{
image_speed == 0; (error message is appearing on this line)
}

im not sure what im doing wrong but the error message says: unnecessary expression image_speed used as a statement
 

sp202

Member
That's a dangerous way of checking the image_index as if you've an image_speed less than 1 then it's likely that won't ever be true. I suggest using round(image_index)==510.
 
That's a dangerous way of checking the image_index as if you've an image_speed less than 1 then it's likely that won't ever be true. I suggest using round(image_index)==510.
Yep, true. I should've mentioned that, too. I'd use if (image_index >= 510) here. Never use == unless you actually want to check whether a value EXACTLY equals something. Almost all of my comparisons are <= or >=
 
Top