Quote:(viii) When the Roll the dice button is clicked, it should perform the following actions:
Simulate the rolling of a dice and place the counter in the correct square.
So use Java's Random class. (Generate an integer % 6) + 1
Quote: If the position of the counter exceeds Square 32, it will go backwards. E.g. if the counter is on Square 31 and the dice number is 4, it will go backwards and land on Square 29.
Run an update loop for this. It's the simplest option (though not the most mathematically astute).
Code:
while diceroll > 0
if position == 32
position -= diceroll
diceroll = 0
else
position++
diceroll--
if position == 32
show congratulations
reset game stateTo make it appear as though the player is moving across the board, make the buttons in the depressed state to show the current position.
EDIT: Oh, you need to show the graphics on top of the boxes. Just draw on top of them. >_>
Quote: Update the message in the text area to display the game status.
When the counter lands exactly on Square 32, a message will be displayed to show the completion of the game:
These seem self-explanatory. All you're doing is updating text. Just put in the text area of the screen what position the player is at, what the dice roll was, and maybe how many turns have been played thus far.
For the counter landing on square 32, just show a modal popup that says "CONGRATULATIONS YOU WON" and show the stats for the game again. When the user clicks on "OK", reset the game state so the user can play again.
