Project #2:
"p2.java"
SUMMARY:
- Sky is light blue by day; darker by night.
- Sea is bluish-green (or greenish-blue),
occupying the lower 2/3 of the sketch,
with brown mud along the bottom.
- On the surface (1/3 from the top),
a red fishing boat sails back and forth,
while a big fish swims back and forth, beneath.
- Title, author, and score are displayed in every frame.
EVENTS:
- Click near the fish (or press the 'f' key)
to reset the fish:
- Start fish on left side (X=0).
- Set fish speed to random value.
- Set fish to random depth.
- Click near the boat (or press 'c' key)
to catch the fish.
- Each attempt subtracts one from the score.
- If boat is above fish (X within 10 pixels), fish is caught:
- Add + 5 to score if daytime.
- Add + 10 to score if nite.
- reset fish (as above).
SCENE
- SKY: light blue when day is true; darker at nite.
- SUN: yellow circle; moves right during daytime (not visible at nite).
When sun reaches right side, it becomes nite; later, day begins and sun reappears on the left.
- OCEAN: bluish-green (or greenish-blue); occupies 2/3 of ketch.
- MUD: Lowest 8 pixels are brown.
BOAT: Red boat moves on surface.
- Boat moves (right or left) by boatDX each frame;
- When boat reaches right side, it reverses direction.
- When boat returns to left side, it reverses direction AND changes speed randomly (between 2 and 5
- When boat reverses direction, make sure it is pointing forward.)
- CLICK near the boat to catch fish -- if it is underneath.
FISH: Fish swims back and forth, underwater.
- Fish moves (right or left) by fishDX each frame;
- When fish reaches left or right side, it reverses direction
AND changes speed to random value.
- When fish reverses direction, make sure it is pointing forward.
- CLICK nearby to reset fish (to left side; random height & speed).
MESSAGES
- Title: large and centered at the top)
- Author at the bottom-right).
- Score is always displayed (on the upper-right)