The program calculates 20 intermediate end points as each side moves between the pentagon and star. This is called "tweening" and is used in animation. I used colour to "walk" the sides around the shapes. Type "stickman animator" into the Scratch search bar to see projects that use tweening.
Written for the Transformations Studio: https://scratch.mit.edu/studios/852144/ I made this remix when I was asked to add colour to the original. I added colour to "walk" the sides around the shapes.