Docsity

Homework Assignment 10: Creating a Cartoon Animation, Assignments of Computer Science

Toggle sidebar
bg1
Homework Assignment 10
Making a Cartoon
Due: Wednesday, November 12th at Noon
Collaboration
In your group, divide up the work so that everyone does some part of it – even if it is only thinking!
At the top of each file you submit for this assignment, you must [i.e. there will be no credit unless you
…] include a statement like this:
/* Collaboration Statement
The following students contributed to this project:
George P. Burdell gte000q – all the coding
Al Gore gtx999z - nothing as usual
Mickey Mouse getgoing - all the thinking
*/
In order to easily identify the programs of each team, you MUST choose a name for your team.
Capitalize the first letter. I will use <team> as the place holder for this name in the following
instructions. For example, you might use "TheTeam." You must email your TA your group by Friday
at 11:59:59 PM.
Assignment
You must write a simple animation program, using Graphic3 and Face3 as the model. Rename
your copy of Graphics3 as <team>App (the application), and Face3 as <team>Screen (the
screen). You will need to rename the classes to be consistent with the file names. For example, these
files would be TheTeamApp.java and TheTeamScreen.java, and the classes would be
TheTeamApp and TheTeamScreen respectively. The animation must include the following
minimum capabilities:
1. A moving picture of some sort
2. A button to start the motion
3. A button to stop the motion
4. Another button able to affect the overall behavior of the animation (reset, fast forward, fast
back …)
Start with simple ambitions, get that working and then enhance it if you have time. Do the assignment
following these steps:
1. Design
Before you write any code, sketch the picture you want to draw and figure out how each part of it
moves: straight line, under gravity, bouncing off something else, … You should try to work out
the appropriate coordinates for positioning and sizing each element.
Also, figure out what the buttons will do, and how they will affect the picture
2. Draw a Static Picture
Change the paintComponent part of the code to draw your picture statically. In the
application, make the text on your window title bar your team name.
3. Change the Buttons
Change the text on the buttons in the application to indicate what you are intending them to do,
and design the methods to pass that choice to the screen. Of course, you may add or delete
buttons as you wish. If you want to pass numbers, I suggest you initialize a suitable default
value, and then use 'up' and 'down' buttons to change the number value one at a time. Look at the
Page 1
pf2

Partial preview of the text

Download Homework Assignment 10: Creating a Cartoon Animation and more Assignments Computer Science in PDF only on Docsity!

Homework Assignment 10

Making a Cartoon

Due: Wednesday, November 12th^ at Noon

Collaboration In your group, divide up the work so that everyone does some part of it – even if it is only thinking! At the top of each file you submit for this assignment, you must [i.e. there will be no credit unless you …] include a statement like this: /* Collaboration Statement The following students contributed to this project: George P. Burdell gte000q – all the coding Al Gore gtx999z - nothing as usual Mickey Mouse getgoing - all the thinking */ In order to easily identify the programs of each team, you MUST choose a name for your team. Capitalize the first letter. I will use as the place holder for this name in the following instructions. For example, you might use "TheTeam." You must email your TA your group by Friday at 11:59:59 PM. Assignment You must write a simple animation program, using Graphic3 and Face3 as the model. Rename your copy of Graphics3 as App (the application), and Face3 as Screen (the screen). You will need to rename the classes to be consistent with the file names. For example, these files would be TheTeamApp.java and TheTeamScreen.java, and the classes would be TheTeamApp and TheTeamScreen respectively. The animation must include the following minimum capabilities:

  1. A moving picture of some sort
  2. A button to start the motion
  3. A button to stop the motion
  4. Another button able to affect the overall behavior of the animation (reset, fast forward, fast back …) Start with simple ambitions, get that working and then enhance it if you have time. Do the assignment following these steps: 1. Design Before you write any code, sketch the picture you want to draw and figure out how each part of it moves: straight line, under gravity, bouncing off something else, … You should try to work out the appropriate coordinates for positioning and sizing each element. Also, figure out what the buttons will do, and how they will affect the picture 2. Draw a Static Picture Change the paintComponent part of the code to draw your picture statically. In the application, make the text on your window title bar your team name. 3. Change the Buttons Change the text on the buttons in the application to indicate what you are intending them to do, and design the methods to pass that choice to the screen. Of course, you may add or delete buttons as you wish. If you want to pass numbers, I suggest you initialize a suitable default value, and then use 'up' and 'down' buttons to change the number value one at a time. Look at the Page 1

end of the paintComponent method in the Map class for an example of how to display numbers on the screen.

4. Implement the Picture Motion In the run() method of the screen, insert the appropriate delay time (milliseconds) and change the variables necessary to achieve the motion you want. public void run() { do { wink = !wink; // <<<< the dynamic action repaint(); try{ Thread.sleep(1000); } // 1 sec catch (InterruptedException e) {} } while (isRunning); } Don't forget to leave in place the do loop to keep it running until your stop button resets the isRunning flag. 5. Test and Enhance Make sure it is doing what you wanted, save the files in a safe place, and then start improving the design. ONE of your team members must turn in the last good working version before the deadline to WebCT. The remaining team members must submit a plain text file for hw specifying which of the team members turned in the working assignment. The TAs will ensure that the team grade is properly distributed to each team member. In recitation on November 13th, there will be a competition among the groups. The winning cartoon will proceed to the lecture competition where you will compete among the winners of each recitiation in your lecture. Page 2