Is there an easy way I can instantiate a worldTile object by utilising a string such as their x/y coordinates (Creating a worldTile instance with a name like ter_12_142 would make things a lot easier for me)?
Or is there a simpler method to go about this?
Here's code for placing tiles in the world;
1 2 3 4 5 6 7 8 9 10 11 12 13 | private void tilePlacement() { for ( int y = 1 ; y < rows - 1 ; y++) { for ( int x = 2 ; x < cols - (cols / 4 ); x++) { int w = (getColor(noise[x][y][ 0 ])); int isAForest = (isForest(noise[x][y][ 1 ])); addObject( new worldTile(w, isAForest), x * scl, y * scl); } } } |