When it reaches the bottom, a new octopus starts from a random location on the bottom
(and optionally with a random, purplish color).
The octopus consists of a purplish body
shaped like a "mailbox"
with a round top,
(see image),
and eight legs below.
USE A LOOP TO MAKE THE LEGS.
OPTIONAL:
All eight legs slant, to the left or right, every few frames,
when the octopus is rising,
but legs are straight downward when the octopus is rapidly sinking.
COLLISIONS:
Boat stops to go fishing; octopus attacks boat.
Click on the boat to stop it (and start fishing);
click again to restart it.
When the octopus reaches the surface,
if the boat is nearby it disappears (and a new boat starts at the left),
and the octopus gets twice as big
as it descends to the bottom.
TEXT: The following text should also appear on the screen:
- Title at the top center of the screen should say: "CST 112 Midterm"
(or "Takehome")
- At the lower left corner of the screen, display your name.
- Also display a SCORE in the upper-right corner of the screen.
KEYBOARD:
Respond to certain keys, as follows:
- d: change to "day"
- n: change to "night"
|
- q: quit.
- r: restart game (and reset score to zero).
|
OPTIONAL FEATURES:
Additional features you may add, for extra credit on in-class midterm.
For the takehome, add at least HALF of these.
- Make sun (and moon) rise and set, instead of remaining horizontal.
- Make the moon a crescent; add rays to the sun.
- Make each new octopus a random shade of purple, and display its number on it.
- Make each new school of fish a random color.
- In each frame, make fish "sparkle" by adding a small random value (0-20) to RGB values.
- When the boat stops, lower a "net" to catch fish; haul up the net quickly, when it hits bottom.
- If the net gets near a school of fish, keep track of the number of fish in the school,
and add it to a total when the net is raised up
(unless the octopus gets the boat, first).
- Display the total catch on the boat, and add it to the score.
- Show the boat sinking, when the octopus catches it.
- Boat becomes smaller after octopus eats it.
(Restore full size after one round trip.)
CODING STANDARDS
- Begin each file with
with comment lines that give your name and project identification, then briefly say what your code is supposed to do
(when it is debugged! ;^> ).
-
On the screen, display a "title" (at the top of the screen)
that identifuies the purpose of your software,
and an "author" line at the lower left) that contains your name and the publication date.
- Begin each function ("method")
with comment lines that give your name and the project ID, then briefly says what your code is supposed to do
(if it works! :*)
- Choose meaningful names for symbols (variables, methods, etc.)
- Comment any code that is non-obvious.
(Don't add comments that merely say the same thing the code says.
Code adequately says WHAT is being done,
so you need not paraphrase is happening;
it is more important to say WHY it is being done.
- Do NOT include any lines of code that you don't understand!
|