forked from League-Archive/IntroToJavaWorkshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlamingNinjaStar.java
More file actions
48 lines (26 loc) · 1.38 KB
/
FlamingNinjaStar.java
File metadata and controls
48 lines (26 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import org.jointheleague.graphical.robot.Robot;
/*** Teacher's note ***/
/* Before beginning recipe:
* 1. ask students to find and explain the variable in this recipe.
* 2. ask students what robot commands they think they will use to make picture in the laminated hand-outs. */
public class FlamingNinjaStar {
public static void main(String[] args) {
int baseSize = 300; //the size of the black part of the star
int flameSize = 200; //the length of the flaming arms
// *14. Use the methods setX and setY to move the ninja star into the center of the screen
// *15. Make some adjustments to see what other kinds of shapes you can make.
// 1. Show the robot
// 12. Set the robot speed to 10
// 13. Make all the code below repeat 25 times
// 2. Turn the robot 1/8 of a circle
// 3. Move the robot 64 pixels
// 4. Turn the robot 40 degrees to the LEFT. (Negative numbers will turn the robot counter-clockwise.)
// 5. Move the robot the distance in the variable flameSize
// 6. Turn the robot 170 degrees
// 7. Move the robot the distance in the variable flameSize (again)
// 8. Turn the robot 64 degrees to the right
// 9. Move the robot the distance in the variable baseSize
// 10. Check that your shape is the same as Figure 1. This is one arm of the ninja star.
// 11. Color your ninja star like Figure 2.
}
}