Hiiiii been a while since I've done a pen project, so I present to you: The Polygon Tool - Version 1.0 you can adjust the number of sides the polygon has using the slider in the top-left all the math is below (you have been warned) The angle the pen has to turn to draw the next line in the way a regular polygon is drawn, it has to find the sum of all the angles in the polygon (n-2)180, and divide it by the amount of sides you have, so (n-2)180/n, but scratch uses the turning mechanism to add on to the angle you're already facing, meaning turning say 135 degrees while already pointing 0 degrees would make it point in a 135 degree angle. Since we already have an entire first ray, we don't need to add 135 degrees to what we already have, and since what we already have is 180, we subtract 135 from 180, so it turns like this 180-(n-2)180/n. NOBODY UNDERSTANDS THIS LOL