Scale decreasing then flips sprite upside down and starts growing

Link to the project or level: [Code.org

What I expect to happen: the balloon will shrink and disappear

What actually happens: the balloon shrinks to 0 scale then flips upside down and starts growing larger

What I’ve tried: This happened in some of my students projects in Lesson 13. I have to put in a condition that says if sprite.scale < 0 then set sprite.scale to 0.

I haven’t run into this problem in the past. I’m wondering why it is doing this now?

@lorikaye ,

Good afternoon. You found the solution to this “bug”. I would have to look at your previous projects to see why it didn’t happen there as this is something that has been brought up in the past. It’s actually not a bug, but rather just how the negative scale works (or how the javascript programmers envisioned it should work).

The solution, is, as you have found, to use a conditional statement to modify the behavior of the sprite to match the laws of physics, although it could be argued that flipping the scale when it becomes negative may be a desirable happening for some programs.

Good luck!

Mike