Question: 1. Create a new class named Scene. 2. Add a main method to the Scene class that simply creates a new Scene object like

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. L 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 im below. Use the methods you created in the preceding activity to position and color the houses exac as in the image. We will adopt the convention that house1 refers to the left house and house2 ref to the right house. BlueJ Shapes Demo X 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.
Step by Step Solution
There are 3 Steps involved in it
Algorithm Initialize the Scene Create a new Scene object Create Houses Inside the Scene object create two House objects house1 and house2 Create Celestial Objects Create a sun and a moon object as Cir... View full answer
Get step-by-step solutions from verified subject matter experts
