CS 117 Assignment: Semi-automaticallly generated skyline


Many complicated movie scenes that you see involve lots of individually generated objects, all assembled together on one screen. A Pixar movie scene of a city (such as in The Incredibles) involves superimposing a number of buildings of different shapes and sizes. For this assignment, you will create a city landscape by drawing a number of buildings of varied sizes.

Create a directory named skyline to store your work, then copy into it the Canvas class from the course directory. Create a class called Building to represent a building in a landscape. Specifically, it should have the following methods:

You should add on your own any private object variables that you need.

Draw your building by doing what you can to make a rectangle look building-like. Add an antenna to the top of the building whose height is proportional to the rest of the building. Add vertical lines running down or across the building, or perhaps add windows. (With the techniques that we have discussed so far, though, your windows will need to scale with the building. We'll eventually talk about techniques which would allow you to have different numbers of windows to scale with the height of the building, but we're not there yet.)

Test your code as you go along. In other words, create another class called Skyline that creates and draws some buildings. As you write methods in Building, test them in Skyline. When you are all done, test your code against the Skyline.java that I provide. It uses a few techniques that we haven't talked about yet, but feel free to take a look. If you have built your Building class correctly, this Skyline program should generate an awesome skyline for you to look at.

When finished, use hsp to submit your skyline directory. Indicate in program comments the full names of both authors (you and your partner), as well as roughly what fraction of the time each team member spent "driving" at the keyboard. You should be working to give all team members approximately the same amount of time driving.

Good luck, and have fun! Remember that lab assistants are available in the evenings in CMC 306 to help out if you need it.