70 likes | 210 Views
Computer Science Final Project “Pig”. Daniel Faught. The Game. Uses two dice Gain points per round based on rolls Lose all points in round if a one is rolled Lose all points if a snake eyes is rolled Can end round at will First to 100 points wins. Goals. Create Pig Game
E N D
Computer Science Final Project“Pig” Daniel Faught
The Game • Uses two dice • Gain points per round based on rolls • Lose all points in round if a one is rolled • Lose all points if a snake eyes is rolled • Can end round at will • First to 100 points wins
Goals • Create Pig Game • Person vs Computer • Person vs Person • Create GUI • Dice GUI • Buttons
Implementation • Used several imported classes • JButtons, JLabels • Used three supporting classes • Die class • PlayerTurn class • CPURunner class • Main class/applet had many similar methods • playerTurn, player1Turn, player2Turn
Implementation • Methods for: • Die • Drawing • Rolling • PvC • Player turn • Player pass/CPU turn • PvP • Player 1 turn • Player 2 turn • Used a private class ActionListener
Initial Program • Initially began with simple dice rolling program • Had to rewrite code from original Pig class • Changed every method in the dice rolling program
Final Product • Works • Capable of playing Pig • Graphic issues • Buttons don’t disappear when they should • Buttons don’t appear in an ideal location • Runs best in full screen