CST 112 projects:
Practice Project #1

On a sketch of size at least 600x400, draw as "scene" and a "hero" creature, as specified below. In your source code, illustrate the proper use of each of the following methods:

Rather than writing your within the "draw()" method, write your own methods for scene() and hero() and call these methods within draw().

Upload your source code as file "p1.java"
(Please do NOT upload any *.java files with syntax errors!)


SPECIFICATIONS for Project 1a


Make the creature follow the mouse.
Also, add text to display your creature's NAME, either on the figure itself or next to it (as it moves).
PROJECT 1 b: Add event handlers for pressing mouse or key.

When mouse or key is pressed, make something happen.

Also, add some other creatures (birds? squirrels?) that move around (in sky? in grass?) but never go off the screen.
(i.e. make them "bounce" off the boundaries.)

Practice Project #2
Starting with specifications similar to Practice Project #1 (above),
change the (hero) creature to move independently of the mouse position,
but move TOWARD the last position at which the mouse was PRESSED. Give the (hero) creaturee a unique name (It should be different from names used by other students, except by coincidence!), and use that name for all of its variables (position, velocity, etc.)

HERO Use float variables for position and velocity, (such as heroX, heroY, heroDX, heroDY ), write code to make the creature continue in a straight line until it hits a boundary (such as the sides of the screen, a horizon, etc.), then BOUNCE off the boundary (reversing velocity DX or DY).

When the mouse is pressed, change the velocity so that the (hero) creature begins moving TOWARD the point where the mouse was pressed (mouseX,mouseY). The velocity variables (DX, DY), should be set to new values that would move the creature TOWARD the point where the mouse was clicked at a rate that would arrive there in a approximately ten seconds or about 300 frames (and continue beyond that point, at the same rate, until "bouncing" off a boundary).

MONSTER Also add a "score" and a second "monster" creature, which moves and bounces off boundaries, similarly. When this second creature comes near the first one, deduct some points from the score, and reset the position of the second creature (monster) to its starting point (or to some random position). Give this second (monster) creature a name, and use that name for all of its variables (position, velocity, etc.)

BIRDS Also add a flock of three birds that fly across the sky (as in project 1b). When the birds reach the edge of the screen, add some points to the score, and start a new flock of birds at a random height. Give the flock of birds a name, and use that name for all of its variables (position, velocity, etc.)

TITLE, AUTHOR, SCORE Display a title, your name, and the score.



Project #3-1
An octopus roams the sea, floating freely below sealevel, bouncing off boundaries.

Click on a button, to change the octopus' position.
Click on the octopus to change its color to a random shade of purple.

OCTOPUS:  A purple rectangle, with eight legs along the bottom, a purple semicicle on top, and an eye that looks in the direction of motion (dx).

SCENE:  Light-blue sky, greenish ocean with waves at sea level. Grass at the bottom of the sea should slant in the same direction that the octopus is moving (dx).

TITLE, AUTHOR:  Display a title, centered at the top, and your name in a corner near the bottom.
Display some instructions, when the '?' key is being pressed.

NOTES: