Sprite scale not reaching conditional in order to shrink it once it reaches a certain size

[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]

**Link to the project or level:Game Lab - Code.org

What I expect to happen: Once the scale reaches 1.5 the stars should shrink.
What actually happens: they stop at 1.49
What I’ve tried: using division changing the value.

Hi @marci.cabrera,

It seems like it isn’t shrinking but it actually is. It shrinks exactly .01 of the scale and then it fails the if statement because the scale is no longer >= 1.5 of the scale so it stops shrinking.

When a single variable no longer works to check in a conditional statement because it is the one that is changing, I usually solve these types of issues by having a second variable, such as grow, that has to be true to tell the star to either shrink or grow. So, for example, when the star is at its smallest, both the grow variable should be “yes” and the size should be greater than .5 of scale and then it will grow. When it reaches 1.5 in scale, grow changes to “no” and it begins to shrink. I have a remix here with one star growing and shrinking.

FYI - I also moved background to the beginning of the draw statement so the animations didn’t layer on top of each other.

Hope that helps!
~Michelle