firstly, thankyou both of you for replying to my question. they look like they will help me get what i want. im not able to try it out and integrat it into what i have at the moment, but i will do soon.
One of you said you were a buit unsure of my references to jpanels and the such. well i used jpanels as a dummy, just to see what i could do if a "tile" had a name.
Using my example of 4 tiles only, i call them tile1,tile2,tile3,tile4. each tile will have the food/wood/ore attributes but also the attribute picture.
a simple algorithm to be used (this is not written in java in this explanation) is using statements eg if..else.
1) tile1 will have a randomly generated number between one and five for each resource. if there are two fives, they are rerolled.
2) the highest number will dictate the type of terrain the tile is on. if there is a "five" then the other two attributes are changed to zero. ( a mixture of numbers eg 3 3 4 gives the attribute - rough)
3) so a "five" in food will class the tile as "grass". With the tile identified as "grass", the appropriate image is used on the tile.
4) the state of the first tile will dictate the state of the other tiles - this means if tile1 is "grass" then tile2 cannot be grass ( ie 5 food ), so tile2 has a "zero" for grass and so on.
i hope to use this to randomly generate different tiles. my use of jpanels was only because it was the only way that i knew of to actually give a tile an identifier. i do not intend to use them. i am aware that this theory is similar to turn based games, such as civilization, but i want to try to implement it into a different type of game. there is information out on the web, but 99% of it is visual basic or c++ ( i want java
). the algorithms are not a problem , i just need to be able to assign those 3 values and be able to assign the appropriate picture to each one. hopefully the suggestions you gave me will allow me to do this :-)