For this assignment, you will make a simple skeleton for this game. You should create a Java program using the Swing graphics package to create a window for your game. The window should contain the following elements that your game will eventually need:
To set the size of your canvas in a FlowLayout, you will probably need to use: setPreferredSize (new Dimension (width, height)) rather than: setSize (width, height). You can also look ahead at the Layout.java example for more sophisticated ways to lay out your window.
You can play the original game or get more information
here.
You can download the Java software from the link on the course home page and run on your own machine. Or you can run it on the suns, type (or put into your login profile): use jdk1.5.0_09 to put it on your search path and then run from the unix command line. You can also use the machines in the Windows NT lab, where Java should should already be installed. Your code should be portable among all of these platforms, but if there are any incompatibilities, your code must ultimately compile and run on the TA's machine, which will be a Windows PC. We will use this first assignment to discover any incompatibilities we didn't know about.
Note: If you are having trouble running java on your PC, make
sure the CLASSPATH environment variable is not set. Some other
program installations may have set it automatically. In Windows, the
environment variables are in the System control panel under
Advanced / Environment Variables. You may also want to add the
directory where the javac program lives (typically something like
C:\Program Files\Java\jdk1.5.0_04\bin or
C:\j2sdk1.5.0_04\bin) to your PATH environment variable.
You can add also this directory to your PATH variable temporarily,
just in a single window, by typing set
PATH=%PATH%;C:\...etc... on the command line.
You should follow these general Java programming practices:
And, finally, for uniformity please name your Java class that has your main program in it Main, in file Main.java
Coding style will constitute a increasingly large percentage of your
grade as the semester progresses.
| Drawing area with a shape/drawing to represent your spaceship | 2 points |
| Control panel with at least one widget. | 2 points |
| Interacting with control panel widget prints out a message to the command line | 2 points |
| Scoreboard panel | 1.5 points |
| Follows all guidelines in Programming Practices section above | 1 point |
| Adds something more, does something new, or significantly surpasses any of the preceding criteria | 1.5 points, see below |
Creating an excellent, nontrivial software application requires creativity beyond what your customers, or professor, can explicitly mandate. In general, great software satisfies a set of general requirements or requests, and then adds something beyond that. Grading for the assignments will reflect this fact. Satisfying exactly the bare minimum for each assignment will merit a grade of approximately 75% or 85%, depending on the specific assignment (15% for this assignment, as listed above). The remaining points will be awarded for additional work that adds the special something. This is not necessarily easy to do. You will be both the software designer and the software developer in this course. It's not just the implementation that is important, but also the design of the application. If you do this, include a brief description in your readme file, as noted in the submission instructions.