Directions for Ellipse Project
Directions for Ellipse Project
(Merry Go Round Art)
Directions
1. Choose a Sprite and make Variables. You may choose any Sprite
you wish.
2. Script Summary - Do not assemble Scripts yet! This is
just an overview.
3. Overview of the Angle Changer Script: Counts from 0 to
350. This sets up for the height and width of the Ellipse.
Steps to Assemble the Angle Changer
Script:
4. Pull a When Green Flag and a Set AngleChanger to
0. This resets the AngleChanger Variable to 0.
5. Add a Forever Loop:
6. Put a "change AngleChanger by 10" script inside the
forever. Put an "if statement" under the change AngleChanger
script.
7. Put a Variable AngleChanger and an Operator "Greater
Than". Put a 359 in the right hand field of the Greater Than.
8. Put the AngleChanger in the left hand side of the Greater
Then. The expression reads "AngleChanger > 359"
9. Put the "AngleChanger > 359" into the if block.
10. Put a "set AngleChanger to 0" inside the if block. This
has the AngleChanger variable count up from 0 to 359 and then reset.
11. Put a "Speed" Variable block next to the stack.
12. Put the "Speed" Variable inside the "change
AngleChanger" block. This allows the user to change the rate that
the AngleChanger counts.
13. Overview of the Moving Scripts. This block uses Sin and
Cosine to calculate the NewY and NewX positions for the Sprite and then
moves the Sprite to those positions.
14. Put a When Green Flag Clicked and a forever block
together.
15. Pull a "sqrt of 10" and an AngleChanger Variable block.
16. Put the AngleChanger block into the "sqrt" block.
17. Pull a Multiply Operator ("*") and a Height Variable block.
18. Put the Height Variable block into the Multiply block.
19. Put the "sqrt" of AngleChanger into the Multiply block.
20. Change "sqrt" to "sin". The express reads:
"sin(AngleChanger) * Height"
21. We are going to assign this value to the NewY variable.
Pull a "set NewY to 0" block and put it next to the "sin" block.
22. Put the "sin" block into the "set NewY" block. The
expression reads:
"NewY = sin(AngleChanger) * Height"
23. Put the "set NewY" into the forever loop.
24. We will now make the NewX expression. Put the following
blocks into the script area.
25. Put the AngleChanger into the "sqrt" block. Put the
Width into the Multiply block.
26. Put the "sqrt" block into the Multiply block.
27. Change the "sqrt" to "cos"
28. Put the the "cos" block into the "set NewX"
block. The expression reads:
"NewX = cos(AngleChanger) * Width
29. Put the "set NewX" block into the forever loop.
30. If you clicked the Green Flag now, you would see the
numbers change for NewX and NewY. But, the Sprite does not
move. We now need to make the Sprite move. Pull a blue "go
to x y" block and a "NewX" and "NewY" variable blocks.
31. Put the NewX and NewY into the x and Y of the blue go
to block.
32. Put the "go to" block into the forever loop. Use the
sliders to set a Height and Width number. Click the Green Flag
and you should see the Sprite move in a Ellipse.
33. Overview of the Size Changing Script. This gives
the Sprite an illusion of moving into the background away from the
viewer.
34. Pull a Green Flag, forever, and a set size block.
35. Pull a minus operator and type "100" in the first block.
36. Pull a multiply and put "0.8" in the second space of the
Muliply block. Pull an addition Operator, a y position block, and
a Height Varable block.
37. Put the y position and Height into the addition.
38. Put the y position + Height into the multiply block.
39. Put the multiply block into the minus block. The expression
reads:
"100 - ((yposition + Height) * 0.8)"
40. Put the minus block into the set size block. The
Express reads:
"Size = 100 - ((yposition + Height) * 0.8)"
41. Put the "set size" into the forever loop. Click
the Green Flag and test.
42. You can also create some great art with the Ellipse
program. Pull a "set pen size to" block and a "change pen color
by" block.
43. Put the "set" and the "change" into the forever loop.
44. We are going to have a clear and pen down to have the sprite
draw. Pull a "clear" and "pen down"
45. Put the "clear" and "pen down" blocks between the Green Flag
and the forever.
46. You can also create some great shapes by having the
computer change the Height and Width Variables automatically.
Create this script and run the program.
47. Create this Script and run the program to vary the Width.
48. To connect to your We-Do Merry Go Round - add these
scripts to the Stage.