In Blue j 1. Create a new class named Scene. 2. Add a main method to the Scene class that simply creates a new Scene object like this: Scene scene = new Scene(); This should be all that is in main at this point. 3. Add a public method named animate that has no parameter variables and returns nothing. Leave the body blank for now. (Hint: What should the return type of animate be?) 4. Add two House fields to Scene. Call them house1 and house2. 5. Add a sun field that can reference a Circle object. 6. Add a moon field that can reference a Circle object. 7. Create a no-arg constructor for the Scene class that creates the two House objects shown in the image below. Use the methods you created in the preceding activity to position and color the houses exactly as in the image. We will adopt the convention that house1 refers to the left house and house2 refers to the right house. 8. Add a sun to the upper-left corner of the scene. (Create the sun object and set the color, position, and size in the no-arg constructor.) 9. When you run main, what appears in the resulting image should match the above exactly. (We are not testing your creativity. We are testing your ability to follow directions. You will be given an opportunity to be creative in the postLab :-) ) 10. In the animate method, move the sun across the sky until it moves completely off the right edge of the window using the slowMoveHorizontal method for the sun object. Add a call to animate in your main method just below the line that creates the Scene object. Now when you run main you should see the sun move across the sky. Add a blue moon object similar to how you added the sun. Place the moon initially off the screen to the left of the sun. You could just copy the sun code and then move moon horizontally. In animate, after the instruction that moves sun across the sky, make moon move slowly across the sky and stop above house2
In Blue j
1. Create a new class named Scene.
2. Add a main method to the Scene class that simply creates a new Scene object like this:
Scene scene = new Scene();
This should be all that is in main at this point.
3. Add a public method named animate that has no parameter variables and returns nothing. Leave
the body blank for now. (Hint: What should the return type of animate be?)
4. Add two House fields to Scene. Call them house1 and house2.
5. Add a sun field that can reference a Circle object.
6. Add a moon field that can reference a Circle object.
7. Create a no-arg constructor for the Scene class that creates the two House objects shown in the image
below. Use the methods you created in the preceding activity to position and color the houses exactly
as in the image. We will adopt the convention that house1 refers to the left house and house2 refers
to the right house.
8. Add a sun to the upper-left corner of the scene. (Create the sun object and set the color, position, and
size in the no-arg constructor.)
9. When you run main, what appears in the resulting image should match the above exactly. (We are
not testing your creativity. We are testing your ability to follow directions. You will be given an
opportunity to be creative in the postLab :-) )
10. In the animate method, move the sun across the sky until it moves completely off the right edge of
the window using the slowMoveHorizontal method for the sun object. Add a call to animate in your
main method just below the line that creates the Scene object. Now when you run main you should
see the sun move across the sky.
Add a blue moon object similar to how you added the sun. Place the moon initially off the screen to
the left of the sun. You could just copy the sun code and then move moon horizontally. In animate,
after the instruction that moves sun across the sky, make moon move slowly across the sky and stop
above house2

Trending now
This is a popular solution!
Step by step
Solved in 3 steps









