I have a question about the scale of sprites. We were playing around with making the sprites grow and shrink. I noticed that when you are decreasing the value of the scale property, once the value becomes a negative number, the sprite begins to get bigger.
So instead of adding and subtracting from the scale, I told my students to multiply and divide.
To grow the sprite - sprite.scale = sprite.scale * 1.05;
To shrink the sprite - sprite.scale = sprite.scale / 1.05;
That way, the scale never becomes a negative number and continues to shrink infinitely.
My question is, why does the sprite get larger once the number is negative? Does the code actually take the absolute value of the number? Just curious.