Analyze and predict: How are the behaviors of these four scripts the same? How are they different?
Analyzing these scripts will help you control the speed of the drawings in the problems below.
"U1L2-SpriteOrbit"
Give Sprite a script that, when the green flag is clicked, draws a blue square, drawing each line at some medium speed.
When you are finished, double-check that your script does exactly what you mean for it to. This is always a good idea when coding because if you move on with part of the program still not working, you will only compound your problems.
You write draw in red.
Create a second sprite with a script that does this:
Test your program. Make sure that it starts both sprites at the same time.
Experiment with the speeds of each sprite.
What happens if Sprite(2) moves 20 steps instead of 5 steps each time it goes through the forever-loop?
What if Sprite(2) moves only 2 steps?
What if Sprite draws its square more quickly?
Describe the results of your experiments. Include pictures of the screen to show what happened. Try to explain why each picture came out as it did.
Sprite doesn't need to move in a square. Try one or more of the following experiments.
Change Sprite's turn to 144 degrees.
Change Sprite's turn so that it makes an equilateral triangle.
Change Sprite's turn to 10 degrees and make the distance it moves in each step much smaller than 100.
Try to make some other interesting designs. Here are some examples:
Describe the results of your experiments. Include pictures and explanations.