Write a Java applet that displays a racing course and at least two racers.
Available from this link is a zip file called race.zip that has the framework for displaying the applet. The zip includes several files:
The provided project/workspace should run as is, but of course not display anything in the applet window... yet (that's for you to do).
- CRace.java which is the basic starting point for your applet,
- ASprite.java which is an abstract class you must extend to create your various drawable classes (sprites are graphical representations of objects in your simulation), and
- CRace.html which will run the applet by referencing CRace.class.
- Race.jcw and Race.jcp which are JCreator project files that include the files above.
- You must use the files in the zip as the basic starting framework for your project;
- You must include a collection type object (vector, List, etc.) that contains your sprites;
- You must have 1 course and at least 2 racers;
- You must follow good coding standards as described in the early class notes (points will be deducted for insufficiently commented code, poor indentation, cryptic abbreviations, lack of or inadequate function headers (see samples in zip file's code), etc.)
- Your project must run with JCreator from one directory (you are free to debug with other IDEs but must submit in JCreator format).
- And, of course, you will be graded on good design of your classes (pay special attention to the principles discussed in class).
- NOTE you do NOT have to animate anything (e.g. you do NOT have to make the racers move). Just display them.
- +2 points extra credit for consistent use of hungarian notation.
- +5 points extra credit for having and displaying two different types of course with different displayable features (for example, random placement of "^" carets for the appearance of a bumpy course).
CRace.java includes a routine you may use to generate random numbers if you choose to place racers and/or characteristics of the course in random spots.
You may use any of the Graphics functions to draw your objects (e.g. drawLine, drawRect, even drawString, etc.)
Updated October 8, 2003