Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to understand array

 
Dheesan Dabycharun
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

am new in java, trying to make a game of snakes n ladders, understood that an array like the below should be to make my board and image work together.
Am using an image with nos 1 to 100 designed on the boardfield.

boardfield = new Field[10][10];
for (int i = 0; i<10; i++){
for (int j = 0; j<10; j++){
boardfield[i][j] = new Field();
}
}

But i can't really understand how to make my image and my array can work together.
Anyone can advise me if i am going on the right track if i post the code here?

Tks in advance.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dheesan Dabycharun wrote:But i can't really understand how to make my image and my array can work together.

Of course, you can add one more instance variable into class 'Field' which hold image for that board.

And welcome to JR.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic