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:
Upload your source code as file "p1.java"
(Please do NOT upload any *.java files with syntax errors!)
When mouse or key is pressed, make something happen.
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.
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: