I am using NetBeans to re-create monopoly board game. I attached my board file into the attachments. I have already gotten the board, dice, players drawn to the screen. My question is how do I get the values from the dice roll so that my images can be moved around the board and depending on where I land it will ask if i can buy, not buy, or pay rent. please any help would be appreciated thanks.

Recommended Answers

All 3 Replies

Use the appropriate method in the Random class to get a random int 0-5 to represent a roll of a single dice? Or is your question something more than just that?

(ps, yes I know it shoud be die)

My question is something more than that. I have already gotten the random Generator working with the dice and it tell me what the dice roll is. But now my question is how would I take that dice roll and tell the pieces that the players choose to move on the board. This is also a gui program and it will show the pieces actually moving on the board. Thanks for your reply.

OK. Without understanding the existing architecture its hard to give a relevant suggestion. Ideally you will have a proper MVC architecture so the controller will update the model by moving the Player to the appropriate Position on the Board, then simply tell the GUI to re-draw using the current state of the model.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.