I'm making small games in C# for fun, and used a guide on youtube to help me in the process. However, I use some of the code the youtuber shows, but there's a bit of it, I don't understand completely.
index++;
//gif animations
if (right == true && index % 15 == 0)
{
player.Image = Image.FromFile("char_right.gif");
}
if (left == true && index % 15 == 0)
{
player.Image = Image.FromFile("char_left.gif");
}
I know that I can change the "% 15" values, and choose how much of my .gif file should be played, during the game, but I'm not sure how the operater "index++" make it work. "index" is defined:
int index = 0;
Can anyone please explain it to me, as I don't want to use something, I don't completely understand :)
Thanks in advance