Answered step by step
Verified Expert Solution
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.
Play the game for yourself on a x grid. Read the rules attached.
Plan out potential classes and objects you'll need to draw out the game
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.
Further develop your box object, use setter and getter methods to update its state. Think about how it may need to "know" if a mouseclick has selected one of its sides.
GAME DESIGN
Your internal representation of the game will be a dimensional array of Boxes. Your visual representation will be a GridPaper that extends JPanel. You will use the tools found in the notes: Swing 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 x grid to a master game x grid. The size of your JPanel "GridPaper" should be no more than x
ESTHETICS
Think about color coding the player's pencil marks and their initials that sit in the center of a finished box. Use GraphicsD 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 testruns 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started