Skyline

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

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


You should add on your own any private instance 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. Draw windows running down and across the buildings. You don't need to crazy making the width of the windows correct or anything like that: some attempt at making some kind of repeated pattern of windows should do the trick. Of course, feel free to get as fancy as you like after you get everything else working.

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 with Part 2, test your code against the Skyline.java that I provide. If you have built your Building class correctly, this Skyline program should generate an awesome skyline for you to look at.

Good luck, and have fun!