Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Sevens: A Dice Game Java Programming

gonzalmo
gonzalmo 


Instructions in text file. Attachments Tags
Clarifications

Answers

Gui Dice Game

mariobeka
mariobeka 



Implemented as described in the pdf file. Attachments
Solution.zip (5 K) Download
Preview
die1.roll( ); int result = die1.getValue(); </code></pre></blockquote> <p> @author Scott Grissom @version 1.4 October 10, 2006 *****************************************************************/ public class GVdie extends JPanel implements MouseListener, Comparable{ /** current value of the die */ private int myValue, displayValue; /** is the dice currently on hold? */ private boolean held, frozen; /** current size

Preview
} /** * Calculate the total of dices. * * @return the total value of the dices that are not held. */ private int getDiceTotal() { int total = 0; for (GVdie dice : dices) { if (!dice.isHeld()) { total += dice.getValue(); } } return total; } /** * Calculate

Preview
{ newGame(); } // player clicked on one of the roll buttons if (e.getSource() == roll1Button || e.getSource() == roll2Button) { theGame.rollDice(); if (theGame.isFirstPlayerTurn()) pass1Button.setEnabled(true); else pass2Button.setEnabled(true); } // player clicked on one of the pass buttons // pass the dice if (e.getSource() == pass1Button || e.getSource() ==

Screenshots
Purchase Answer