CST 112 Project #4
All code for this project should be saved
in files whose name begins with "p4".
See below for the NOTES about
Following the instructions (see below), write your own (Processing) Java code
for this project.
Write Java code to define and use these object classes:
Each instance of these objects should have a global name,
but properties should be defined within the object class
(and global variables should not be used as properties of these objects).
You may start with the code in
Modify this code as needed; write your own code
to replace ALL of the
Change the values of the String variables to give the racers different names,
(instead of "First", "Second", and "Third")
and be sure to change the author to contain your own name.
I N S T R U C T I O N S
Create a dynamic sketch
as described below.
- A racetrack with three parallel tracks (horizontally).
In each track, a racer
(a random amount)
when its button is clicked.
Each racer should be a different color,
and drawn with at least three shapes..
Four buttons are used to make the racers move:
- Three buttons have the name of a racer,
and are the same color as that racer.
The fourth button moves ALL three racers.
After the race begins, two small varmits
run back and forth between the tracks
(bouncing off the ends).
- The title and author are displayed on the screen:
When a racer crosses the finish line, the winner's name is displayed.
- racers and varmits should all display some sort of animation, as they move.
Screen shot from
to which you should add your own code.
To view a working demo,
Click this link,
(then press 'A' for autopilot!)
You may also check out this sketch for ideas:
Jumping Roo Race|
(Code for this sketch is available at
Jumping Roo Race
but write code for your own sketch, to do something simpler!)
regarding Remote Learning,
Since we are now in a "Remote Learning" mode, you must
save your code in your folder as you work on this project,
and participate in periodic Code Reviews to discuss your code
(and provide help, when needed).
- Each time you make changes to your code,
create a new file
(with a name that begins with "p4"),
to save it in your folder.
- Your coding must be discussed directly with me during periodic "Code Reviews"
(at least a couple of per week)!
- If there are no files with preliminary code in your folder,
or if periodic code reviews do not occur,
then the completed code will not be accepted or graded.
- Your completed Project #4 should be submitted by Tuesday, May 5th.
- It will then be used as the basis of the next exam "q4"