Results 1 to 2 of 2
  1. #1
    fatabass is offline Senior Member
    Join Date
    Nov 2011
    Blog Entries
    Rep Power

    Default Guidence on my design please..


    I am planning to make a simple Yatchzee Game.

    Basically, you roll 5 dice in your first turn. Then hold any number of dice as you wish, and roll the rest. And you do this step one more time.
    With the 5 dice you rolled after 3 turns, you pick a slot from possible options ( 1's, 2's, 3 of A kind.. ) and get some point depending on the dice you have rolled.

    I have already done something like this:
    Guidence on my design please..-01.png

    But everything is just in 2 classes, and it is really, really messed up.

    I do not want any code, or tell me how to do this..

    All I am asking is:

    How would you think of classes?

    A Dice class ?
    A Dice Roller class ?

    But what else ?

    ( When you click on the buttons, you get the point to the lower part. The upper part of the frame shows the possible points you can get with the rolled combination )

    Thank you.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Guidence on my design please..

    A Dice class, which would handle how a single Dice rolls as well.
    That would be pretty simple.

    A Hand class (I think they're Hands in Yahtzee?) which would contain the 5 Dice, as well as handle which ones are being thrown, and the number of throws.
    I'd have a ScoringRules class as an attribute of that which would have the logic. The Hand would pass the dice (or itself) into the rules and get a value back (points plus name maybe?). Would have to take into account what had already been scored, so probably need the Player in there as well, or at least their Scorecard.

    Then you'd probably have a Game.

    This is just off the top of my head.

Similar Threads

  1. Preview design vs Run design
    By diamonddragon in forum NetBeans
    Replies: 3
    Last Post: 02-06-2012, 08:11 AM
  2. gui design
    By droidus in forum AWT / Swing
    Replies: 0
    Last Post: 01-28-2012, 12:36 AM
  3. Java Guidence for a beginner
    By rohitj in forum New To Java
    Replies: 5
    Last Post: 09-14-2011, 06:49 PM
  4. GUI design
    By kennyblue in forum AWT / Swing
    Replies: 6
    Last Post: 11-10-2010, 05:59 PM
  5. help: I want to design 2D map?
    By mofaker in forum AWT / Swing
    Replies: 4
    Last Post: 10-29-2009, 12:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts