| |
Lab 20: Solar System VIII
Page history
last edited
by Mr. Kretsch 2 months, 3 weeks ago
Name: ___________________________________________________________________
Objective: Passing objects to methods
Instructions:
- Open your Solar System Lab
- Import the files from Lab 20 Solar System VIII. You will be importing two files: a new applet file and a class called Blackhole.
- Be sure your Spacecrafts have methods that can return their current location.
- Modify the Blackhole class as follows:
- Black holes are hollow white circles created in the center of the canvas. Every black hole should be the same size.
- Black holes can report if a location is contained within itself.
- Black holes have a methof called pull, which takes one Spacecraft object. The pull method moves the spacecraft half-way towards the black hole.
- Modify the applet as follows:
- Create two different spacecraft objects. Start their animation,.
- If the user clicks within the black hole, pull the two spacecraft towards it.
Grading
| Feature |
Points |
Out of |
Notes |
| Blackhole class |
|
7 |
|
| Applet |
|
3 |
|
| Total |
|
10 |
|
Notes
Lab 20: Solar System VIII
|
|
Tip: To turn text into a link, highlight the text, then click on a page or file from the list above.
|
|
|
Comments (0)
You don't have permission to comment on this page.