CPSC 170 Post Lab 5
Level Editor
Due Before Class on Friday, February 13th

For this assignment you will modify your break out program from postlab 2 to include a level editor. A level editor is program that allows the user to interactively layout aspects of a game. The level editor for your break out game will allow the user specify the location and size of bricks.

Details

You should begin by creating a class that represents all of the bricks in a game of break out (this class could extend ArrayList). Add two methods to this class for reading and writing the collection of bricks to a text file. If there are any exceptions when reading a file, the read method should generate a default collection of bricks. If there are any exceptions when writing a file, the program should display a dialog box informing the user that no file was written.

Modify the break out game to use the new collection of bricks class. The game should read a brick file as part of its initialization.

Next, create the level editor program that allows the user to draw rectangles that represent bricks in the game. This can be based off of the drawing programs that we created in class. You do not need to worry about deleting or editing bricks that are already added. This program should use the same collection of bricks class that is used in the game. The level editor should include a menu item that when selected saves the collection of bricks to a text file.


Hand In: Tar and email your code to your instructor with a subject of cpsc170 postlab5.