Skip to main content
gamedev.net
🔒 Locked

[java] Storing game data for monopoly?

Started by morefire Oct 31, 2002 at 10:19 AM 5 replies 800+ views
Original Post
morefire
morefire
Hi, Im about to start developing a monopoly game in Java, however im not too sure about where to store the information about the individual streets? e.g. an example street holds the following data: StreetID StreetName Rent Mortgaged? Owner XCoordinates YCoordinates // These will be used for moving game tokens and im sure theres a bit more, but you get the idea. So wheres the best place to store them? in an array? example? in a file? or any other ideas. Thanks in advance.
Phoenix1_3
Phoenix1_3
I think array would be best, unless you want a save option then you should use file

but why are you using java?
c++ is better for games, as far as I know

Grtz
Phoenix
"Computers are like airconditioners, they will crash when you open windows"
ZeroEffect
ZeroEffect
It's a fixed board size so I don't see why you couldn't just use an array of street objects and then just access the array based on the streetID. But don't keep just the buyable properties in this array, keep all valid squares on the board in the array where "GO" is 0, Med. Ave is 1, CommChest1 is 2, Baltic is 3, etc. Then you can just access what property a player is on by their current position on the board and get any related details that pertain to the type of property.

edit: In a game like monopoly there is nothing wrong with using java. It's not a graphical and processor intensive game unless your planning to add in some outragous specialFX.

Chris Z.
ZeroFX Interactive

[edited by - ZeroEffect on October 31, 2002 11:39:41 AM]
Chris Z. GPU FX
Big Sassy
Big Sassy
I'd imagine storing it in an array would be fine. In the array you could have all the streets in the order they appear on the board. Then when the user rolls the dice, you just "move" the piece down the array the amount that was rolled. So if the user is on Park Place and rolls 2, you would "move" the player down from the array index Park Place was on 2 places in the array to land on the array position Boardwalk is at.

I don't know how you are implenting moving the pieces around, so I don't know if this would work for your implementation. Anyway, good luck with the project.

edit - Yeah, what Zero said. And Java is fine for Monopoly.

***********************
          

[edited by - Big Sassy on October 31, 2002 11:48:47 AM]
morefire
morefire
Thanks alot for all your help, much appreciated =)
Tylon
Tylon
morefire, just out of curiosity, are you doing the Applied Computing course in Dundee?
morefire
morefire
nope, sorry I live in London. =p

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.