wood burning stoves 2.0*
The moose likes Java in General and the fly likes Java Monopoly game design.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Monopoly game design.." Watch "Java Monopoly game design.." New topic
Author

Java Monopoly game design..

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
Does anyone know how to go about designing a monopoly game for Java?

Thanks.
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
Yes

Do you have specific questions?


"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Barry:
Does anyone know how to go about designing a monopoly game for Java?


Even if I know, do you want me to put my entire code here?

ShowSomeEffort while asking questions.


apigee, a better way to API!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
Even if I know, do you want me to put my entire code here?

Take it easy, guys. The question was about design, not code. And now let's wait for Barry to clarify what he's stuck with.


Ping & DNS - my free Android networking tools app
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Originally posted by Ulf Dittmer:

Take it easy, guys. The question was about design, not code. And now let's wait for Barry to clarify what he's stuck with.


yeah true.
Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
Yes, my question was about class design not code.

thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
What ideas have you had so far? Are you wondering about a particular design idea?
Piet Verdriet
Ranch Hand

Joined: Feb 25, 2006
Posts: 266
Originally posted by Barry Brashear:
Does anyone know how to go about designing a monopoly game for Java?

Thanks.


Try writing out the game and it's rules on a piece of paper (or just get the official manual). Then underline all the nouns and verbs on your piece of paper. The nouns are candidates for classes while the verbs are candidates for methods of those classes (of course, not all of them are relevant!).
Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
Thanks. I guess that would include board, player, property, hotel, house, etc.
Piet Verdriet
Ranch Hand

Joined: Feb 25, 2006
Posts: 266
Originally posted by Barry Brashear:
Thanks. I guess that would include board, player, property, hotel, house, etc.


Among others, yes. And these are all classes.
A "verb example": a player should have a method called move(...) to move from one section of the board to another.

Also, there could be a main class called Game, which holds the references to a Board instance, Player instances, a couple of Die (Dice) instances, etc. In that Game instance, you create a loop that keeps on looping giving each player on the board a turn to play. This loop is terminated whenever one of the players has won.

Good luck.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
While the verb/noun approach provides a first approximation at an object model, I'd say that it'd be a mistake to take its results too literally. A good object model isn't necessarily the one that mimics the real world perfectly - it needs to make sense for the application code.

E.g., I don't see what methods house or hotel objects would have. They differ in the amount of rent due, but that's an attribute of the property. So I might make the number of houses/hotels fields of a property object they belong to.

And there might be other objects that have no corresponding physical object.

You might find this discussion about modeling a tennis match interesting.
[ July 11, 2008: Message edited by: Ulf Dittmer ]
 
wood burning stoves
 
subject: Java Monopoly game design..
 
Similar Threads
Laptop: which brand to choose?
game dev book ?
Java Monopoly Game AI and Neetwork
WA #2 ..... word association
Idea for my Final Year Project