Added looping functionality to AnimatedSprite