Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students also viewed these Databases questions

Question

6. Are my sources reliable?

Answered: 1 week ago

Question

5. Are my sources compelling?

Answered: 1 week ago