COSC 174 - Computer Games
Assignment #1

Due Date: Wednesday, Jan 21, 2009

GOAL: Write a Java applet which displays a picture. The applet should be 400 pixels wide by 300 pixels high. Your picture should involve at least two types of shapes (lines, rectangles, ovals, etc.) and at least two colors. You should use for-loops to draw multiple copies of the shapes, not just a lot of separate draw statements. For instance, you might draw 4 red boxes down the right side and 7 vertical blue lines across the applet (using two for-loops), giving something like:

METHOD: You can find information about writing and displaying applets in notes from class, and in the document How to Run Java.

EXTRA: As explained in the course syllabus, completing the bare minimum program will earn you a B on this assignment. To get a higher grade, you should do something extra to show off. What you do is up to you, but it should demonstrate that you have thought more about your program.

For this assignment, possibilities might include changing the sizes of the shapes across the screen, drawing some fancier pattern, alternating colors, etc. In this last instance, it might help to note that

    if (n%2 == 0) ...
will test if the number n is even.

HAND-IN: You should email me a copy of your .java file and your .html file (to display the applet) before the start of class on Wednesday. Be sure that your program includes comments saying who wrote it.