CS 1713 Laboratory 11:
A GUI for Craps

Note: This laboratory builds an interface for a dice game and extends over 2 class periods. Most of the work will be done in the laboratory. You must attend both of the three laboratory periods to receive credit for this lab. The goal is to build a working GUI-based Craps game.


Hand-in Requirements (Deliverables):

All projects and laboratories will be submitted electronically through webCT. Zip up your entire project directory to submit as the source. (Right click on the project folder and follow the SentTo link.) The project source directory should include the following classes:


Week 1 will focus on building a basic dice drawing object called DiceDrawer. You will create an applet to test the drawing of the dice. The DiceDrawer object has a method:
   public void drawDiceFace(Graphics g, int value);
that uses g to draw a die with the specified value at (0, 0).

During week 2 you will lay out a GUI with panels, buttons and labels to represent the user interface for a craps game. In week 3 will you add action listeners to play the grame.

To begin the project download craps.zip into a directory not under your workspace.
Create a new project called lab11.
All classes in this project will be in the craps package. Create three classes: DiceDrawer, DicePanel, and DiceApplet. Cut an paste the code for these from the craps.zip file.

Week 1: Developing a dice drawing object.

Week 2: Graphical layout of a craps game

This week's laboratory designs the layout of a craps game in which a player rolls two dice. The goal will be to produce the following layout:

Week 3: Adding actions to play the game

In this week's laboratory you will add action listeners to the GUI developed last week in order to implement a craps game. In this version of the game, a player rolls two dice and wins the game if the sum of the rolls is 7 or 11. Otherwise the player loses.