I think this could be made a bit smaller by making use of FLR() to divide the modulos. Since it's one-sprite, maybe don't need 2-variables to keep track of it ? Maybe ...