Write a Java Application program that declares, instantiates and uses an array of objects. In addition to the MUFrame.java and MUPanel.java files, your program must include at least two additional class definitions:
- a “hero” class that will be used to set up a visual object that can be moved around the screen with button clicks, and
- an “obstacle” class that will be used to set up an array of visual objects that the “hero” object will attempt to avoid or capture.
Use your creativity to enhance the basic requirements shown above. You don't have to do this, but it might make your work more interesting for you. Here are some suggestions for enhancing your project (you are not limited to this list - try things out!):There are many more fun things you could include in this project. Enjoy!
- Draw interesting shapes for your hero and/or obstacles on screen.
- Use Images for the hero and/or obstacles, or have an image as the background of the screen.
- Use animation (as seen in the optional part of Lab 8) to make things move or otherwise change on screen between button clicks.
- Implement some actual game that you have played and like.
CSC 120, PA6, your name, date & Description comments in MUPanel.java. | 3 |
The Description comment must include a discussion of the goal of the program; what is the “hero” object attempting to accomplish? Should the “hero” be moved to a certain screen area, attempt to "capture" all of the obstacles, or what? | 3 |
Project contains a “hero” class and one “hero” object that is drawn on screen and may be moved by button clicks or other GUI actions. | 6 |
Project contains an “obstacle” class and an array of “obstacle” objects that are drawn on screen and have a different appearance from the “hero” object. | 6 |
“hero” object moves correctly according to labels on the buttons. | 7 |
all “obstacles” move, grow and/or shrink when every button controlling the “hero” is clicked. | 8 |
Program detects when “hero” is overlapping any “obstacle” object and responds appropriately. | 5 |
If “hero” reaches the goal, a message to that effect is displayed on screen. | 4 |
Your code is easy to read, and indented consistently. | 3 |
Total | 45 |