I think ">=" is correct!
The original image has 9 sprites: 3 for down, 3 for up and 3 for right or left. So, the indexes of "sprTiles" array are:
> 0, 1, 2 for down
> 3, 4, 5 for up
> 6, 7, 8 for right/left
When "monster.anim_frame" has the value 3, it must be set to zero because we do not use "monster.anim_frame" equals to 3.
The original image has 9 sprites: 3 for down, 3 for up and 3 for right or left. So, the indexes of "sprTiles" array are:
> 0, 1, 2 for down
> 3, 4, 5 for up
> 6, 7, 8 for right/left
Code Sélectionner
if(monster.anim_frame >= FRAMES_PER_ANIMATION) monster.anim_frame = 0;
When "monster.anim_frame" has the value 3, it must be set to zero because we do not use "monster.anim_frame" equals to 3.