Topic was automatically imported from the old Question2Answer platform.
Asked By
quadra123
I’m following this tutorial however i cant understand this one:
Why does he add “% composite_sprites.hair_spritesheets.size()” after “(curr_hair+1)” ?
(around 7:58)
the % is the modulo function, it finds the remainder of something so he is checking if the remainder of curr_hair+1 / the size of the spritesheet has a remainder. What he is doing here is making certain that if he has three different hairsyles then the integer can never go above 3. The below may make it a bit clearer but would be less efficient code