CIT 594 Assignment 7: Robot GUI
Spring 2012, David Matuszek
Implement a "robot" that moves about in a GUI and responds to commands. The GUI "game board" will contain other kinds of objects (Pieces), including Blocks.
For this assignment you will use a BoardGame package that I have developed.
Notes:
Test.java and BigGui.java. These are just throwaway programs that do somewhat random things that aren't worth documenting. You can use these as models for your own code.Block.java is a subclass of Piece that you can adapt to your own needs.Start a new package for your code. Use your login name (or actual name, or something similar) as the name of your package.
Create a RobotPiece singleton object that extends Piece. This object needs to implement the public void paint(Graphics g, Rectangle r) method.
java.awt.Rectangle.Piece objects are not expected to include any logic beyond what is necessary to draw them properly.The RobotGUI singleton object will:
Board and assorted controls.Pieces, including some Blocks, and place them randomly on the Board.
Coins, Tazers, Diamonds, OilCans.Pieces, of the same or different types, except for Blocks.Block may not contain anything else. (Blocks are basically "walls.")RobotController. RobotController, which controls the RobotPiece.The GUI should accept the following commands from the user:
The details of the GUI (buttons, text fields, etc.) are up to your discretion, but should be reasonably intuitive. Remember that your instructor and/or your TAs will have to try to use it.
Your RobotController object should create just one RobotPiece, which is not immediately placed on the Board. The RobotController then handles all the logic for the RobotPiece. It provides methods that are called by the GUI, and attempts to do what the GUI tells it to do, subject to the constraints listed below.
Here's what the RobotController should be able to do:
RobotPiece on the Board, in a given location.
Block. (It is okay to place the robot where there are other types of objects.)RobotPiece from the Board.
RobotPiece is not on the Board, it will be unable to move, to pick up objects, or to drop objects. It will, however, be able to turn.RobotPiece to face in a given direction.RobotPiece 90° to the left or right, or 180°.RobotPiece forward (in the direction it is facing) some non-negative integral number of squares.
Block.RobotPiece.
RobotController must maintain a list of the objects that it is "holding."RobotPiece.
RobotController is not holding any of the specified kind of object.RobotPiece must move to "on top" of it, so that the display of the RobotPiece is not obscured.Board, Piece, and possibly Block).
Your program is due before 6am Tuesday, March 20. Zip up the entire directory for this project, and submit via Blackboard. Only assignments submitted via Blackboard will be accepted--any assignments emailed to me will be discarded without comment. A late penalty of 5 points per day (out of 100 points) will apply.
Because many of you are interviewing this semester, a limited number of 48-hour extensions will be available. To get an extension, email me before 5pm Friday, stating the reason you need the extension. No extensions will be granted after Friday. If you get an extension and fail to get the project in by the extended due date, late points will be counted from the original due date.