MIDTERM EXAM -- CST 112 (Fall 2012)
In-class portion:   Wednesday, October 26
(Take-home portion due October 31)

Using the "Processing" language, create a "sketch" that meets the SPECIFICATIONS given below.

SYNTAX: All code must be syntactically correct; code that does not compile and run, will not be accepted.

CODING STANDARDS: Readability of code is an important grading criteria for both the in-class and the takehome portions. Coding Standards [SEE BELOW] will be strictly enforced on the takehome portion, and credit will be deducted on the takehome portion when they are not followed.


SPECIFICATIONS

SCREEN Screen is 700 pixels wide by 500 pixels high.
The top half of the screen is the "SKY" [see below] and the lower 3/4 of the screen is the "OCEAN" [see below]. (The "surface" of the ocean is at height/2.)
BEWARE: Various creatures traverse or lurk within these two regions, and may commit nefarious actions within during the day or night!

DAYTIME (when the boolean variable "day" is true")
During the daytime, the sky is light blue, a yellow sun appears in the upper-right portion of the sky, and a "BIRD" [see below] flies across the sky, from RIGHT to LEFT, every three seconds.
(To move ten pixels per second, at thirty frames per second, the x value should increase by 0.3 pixels per frame.)

NIGHTTIME (when the boolean variable "day" is false")
During the night, the sky is darker, a pale-pink moon appears in the MIDDLE of the sky, The "WITCH" [see below] flies on her broom, across the night sky, from RIGHT to LEFT, every ten seconds, and the "OCTOPUS" [see below] slowly bobs up-and-down, from the bottom of the sea to the surface.

WITCH
The WITCH consists of a black triangular hat, a red face, a brown rectangular body, and two green legs, riding on a BROOM that has seven (7) bristles. (See image at the right.) USE A LOOP TO MAKE THE BRISTLES

The WITCH flies across the night sky, every ten seconds, from RIGHT to LEFT. When the WITCH passes the moon (at the center of the screen), reduce the score by 50 points (only ONCE per passing).

The OCTOPUS slowly bobs up-and-down, from the bottom of the sea to the surface.
The octopus consists of a dark body shaped like a "mailbox" with a round top, (see image), and eight legs below. USE A LOOP TO MAKE THE LEGS. All eight legs should slant, either to the left or to the right, every few frames, when the octopus is rising, but go straight downward when the octopus is sinking.

BIRD: (flies across the daytime sky, every three seconds)
The bird consists of two large purple triangles.

FISHES: Three fish, each with a different, bright color, swim around during the daytime (only).
When daytime begins, all three fish all start in the center of the ocean, then swim away with random velocities from +7 to -7 pixels per frame in X, and from from +5 to -5 pixels per frame in Y. Each fish consists of an ellipse with a triangular tail at the BACK (i.e. the tail should be on the LEFT if the fish is swimming to the RIGHT, and the tail should be on the RIGHT if the fish is swimming to the LEFT.)
TEXT: The following text should also appear on the screen:

EVENTS:

CLICK: Clicking causes different effects, depending upon WHERE the mouse is located. KEYBOARD: Respond to certain keys, as follows:

CODING STANDARDS