PROJECT 2

Redo Project P1, using functions with arguments to draw the objects.

For example, instead of drawing Zoog with statements like this:

		fill( 255,200,200 );
		ellipse( zoogX, zoogY, 30,30 );		// Head

		// +++ add eyes, here.

		fill( 255,255,200 );
		rect( zoogX-20, zoogY+15, 40, 80 );	// Body

		fill( 0 );
		text( "Zoog", zoogX-15, zoogY+35 );	// Name
Call a function with arguments, such as this:
		showZoog( zoogX, zoogY );

ALSO:   Add eyes to a character's face,
and try to add some animation (changing shape from frame to frame).


The following is identical to the instructions for Project 1.


PROJECT 1

Pick another name for the "hero" character (Zoog), and modify your code from Project 0 (see below) to add a few more items and animate some of them (changing position from frame to frame).

Make at least three things move. For example:

Upload code into your folder, in a file named project1.java

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.
    	} 

Additions to project 1:

  1. Put some trees on the horizon.
  2. Add a bird that flies across the sky, from right to left, and drops a bomb whenever you press the 'b' key.

  3. Add a rabbit (or other creature) that runs back and forth near the bottom of the screen, reversing direction whenver it hits the left or right side.
  4. Make the rabbit go faster (by about 10%) whenever you press the "+" key, and slower (by 9 or 10%) whenever you press the "-" key.
    (Be sure to use "float" type for the position and speed of the rabbit.)


PROJECT 0

Make a (static) sketch that includes
a scene and some creatures.

SCENE: At least five items, such as:

  • Sky
  • Grass
  • Sun, in the sky
  • Cloud(s), in the sky
  • Bird(s), in the sky
  • House
  • Tree(s)
  • Cow
  • ... whatever ...
CREATURES: At least two creatures, such as
  • Hero
  • Dog
  • Monster
  • Treasure Chest
  • ... whatever ...
TEXT: Add some text, on the screen, such as:
  • A Title (centered, near the top).
  • Author's name (you), in lower-left (or right) corner.
  • Perhaps a name, on the hero's shirt.