CST 112 Project #4
"Racers"
.
All code for this project should be saved
in files whose name begins with "p4".
See below for the NOTES about
Remote Learning,
participation requirements,
and
Code Review.
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
p4start.pde
Modify this code as needed; write your own code
to replace ALL of the
+++
lines.
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.
- Racetrack:
- A racetrack with three parallel tracks (horizontally).
- Racers:
In each track, a racer
moves
(a random amount)
when its button is clicked.
-
Each racer should be a different color,
and drawn with at least three shapes..
- Buttons:
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.
- Varmits:
After the race begins, two small varmits
-
run back and forth between the tracks
(bouncing off the ends).
- Messages
- The title and author are displayed on the screen:
When a racer crosses the finish line, the winner's name is displayed.
- Animation:
- racers and varmits should all display some sort of animation, as they move.
Screen shot from
p4start.pde
("starter code"),
--
to which you should add your own code.
|
Screenshot from
demo 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!)
|
NOTES
regarding Remote Learning,
participation requirements,
and
Code Review.
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"