PROJECT 2

SCENE

Blue sky above a green sea (occupying about 3/4 of the window).
within the sky are two buttons and a "score" (see below).

BUTTONS & SCORE

A "GO" button starts up the fishing boat.
A "CATCH" button catches any fish that are below the boat.
The score shows how many fish have been caught, so far.

FISH

Under the sea, three fish swim across the window, from left to right.
When a fish reaches the right side, it disappears then reappears on the left side at a new random height, and swims to the right with a new random speed.
Each fish should consist of a (different-colored) ellipse, with a triangular tailfin at the back and a round eye at the front.
If possible, give the fish some animation, such as a flapping middle-fin or a winking eye.

BOAT

On the surface of the sea, a boat begins sailing slowly from left to right when the "GO" button is clicked.
When the boat reaches the right side, it turns around (pointing the other way!), and begins moving back to the left side.
When the boat returns to the left side, it disappears (until the GO button is clicked again.)
If possible, animate theboat, with a flopping mast and/or bouncing on waves.

CATCHING FISH

When the "CATCH" button is clicked any fish that is directly underneath the boat gets "caught" (but the boat does not stop).
When a fish is caught, the score is increased by one and that fish stops swimming to the right (and another fish begins from the left, at a random height and speed).

METHODS: Write separate functions to do each of the following tasks:


Upload your source code code into your folder, in a file named project2.pde on or before midnight, Wednesday, March 15th.
There will be an in-class coding exam on Monday March 20th.

REMEMBER:   Code readability is very important.
  • Start each method with a comment saying what it does.
  • Pick meaningful name for variables.
  • Properly indent each
    	{
    		block 
    		of
    		code.
    	} 
  • Be sure to display a title at the top sketch and your name near the bottom.