wood burning stoves*
The moose likes Beginning Java and the fly likes trying to understand array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "trying to understand array" Watch "trying to understand array" New topic
Author

trying to understand array

Dheesan Dabycharun
Greenhorn

Joined: Nov 16, 2009
Posts: 3
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trying to understand array