CMSC 110 (Introduction to Computing)
Spring 2011
Assignment#3
Due before start of class on Thursday,
February 17, 2011
First, read Chapters 1, 2, 3, 4. 5, 6 & 7 from Shifman's text.
Task: Design an object. This could be whatever you feel like
drawing. To draw your object, you should use the following function:
void drawMyObject(float x, float y, float objectWidth, float
objectHeight) {
...
}
Insert the name of your object in place of "MyObject" in the fuction
name.
Write a program that draws several versions (at least 3) of the
object in a 500 x 500 sketch. You should use the random number function
to generate x, y, objectWidth and objectHeight values, so that the
sketch changes each time it is run. You can also vary the coloring of
the object each time it is drawn.
Your object must interact with the mouse in two manners:
- Based on the position of the mouse. You can design
this interactivity however you like, but here are some ideas to get you
started:
- Having eyes that follow the mouse position
- Flapping wings as the mouse moves
- Changing color as the mouse gets closer to the object
- Anything else you like!
- Based on when the mouse is over the object. Again, you can
design this however you like, but here are some ideas:
- Smiling if the mouse clicks on or travels over the object.
- Getting angry (e.g. changing to red, snarling, etc.) if the
mouse travels over the object.
- Saying something in a text balloon when the object is clicked
on.
- Anything else that interests you!
While you may have an object that follows the mouse, you cannot count this toward either of
the two interactive components.
Pay special attention to the aesthetic aspects of your design as
well as interactivity. Your sketch should be creative!!
Hints:
- Keep it simple at first. Start with something basic, get it
working, and then build upon it piece by piece, each time ensuring it
is working before you move on to the next piece.
- Start with a hand-drawing of what you want, preferrably on graph
paper.
What to Hand in:
- Hand in the entire sketch folder in your Dropbox folder.
- In this folder, be sure to include:
- A gif/jpg/png image of your finished sketch.
- The write-up, described below
- Your source code
- Also, print out and hand in a copy of a brief writeup in
class. Your write-up should include:
- The first page showing your sketch, followed
by a title, your name, a short 1-2 line description
- The second page should include a short 1-2 paragraph more
detailed description of the sketch and your
personal experiences working on this sketch
- A printout of your source code