Question: You are to design a two player game ( Human vs . Human ) of this classic game, sometimes known as Pigs in a Pen.

You are to design a two player game (Human vs. Human) of this classic game, sometimes known as Pigs in a Pen. You should do this in several phases.
1. Play the game for yourself on a 3 x 3 grid. Read the rules attached.
2. Plan out potential classes and objects you'll need to draw out the game
3. Create a paper object of type JPanel and have it respond to a user's mouse clicks such that you can connect dots. No game logic at this point.
Now review your understanding of OOP. Develop an object that has state information that represents the four parts of a box: top, bottom, left and right side. When the box is 'closed' allow it to set a single char in its center representing the player who closed the box.
4. Further develop your box object, use setter and getter methods to update its state. Think about how it may need to "know" if a mouse-click has selected one of its sides.
GAME DESIGN
Your internal representation of the game will be a 2 dimensional array of Boxes. Your visual representation will be a GridPaper that extends JPanel. You will use the tools found in the notes: Swing 101 to include a button to do the following: start game / restart game. JOPtionPane should be used for any other messaging (like who won). The start game button will allow the user to pick the playing size from a simple 3x3 grid to a master game 8x8 grid. The size of your JPanel "GridPaper" should be no more than 640 x 480.
ESTHETICS
Think about color coding the player's pencil marks and their initials that sit in the center of a finished box. Use Graphics2D and the stroke size appropriately. Make it clear who's turn it is by placing some text on the GridPaper indicating turn. Think carefully about playability and useability.
JOURNALLING
At this point, you should be keeping notes daily on your progress and include these along with test-runs and debugging sessions. DO NOT include screen shots of major chucks of code - small sections are fine if they come up in debugging. Ask for clarification whenever necessary. READ THE RUBRIC

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!