can anyone help me?
i want to recreate a grid, which i already build, but by using a new Class with an three dimensional array, which should run through the field and display the grid with its objects.
the first dimension represents the cells in x-coordinates, the second dimension the cells in y-coordinates and the third should regive the objects which are in the cells. i'm now so far, but i'm stuck:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | //Methode, zum Erzeugen einer neuen Welt public void makeWorld(welt neuewelt) { neuewelt.setBackground(background); neuewelt.setOrigin(originX, originY); String[][][] objects = { }; for (j = 0 , j <= objects.length, ++j); for (n = 0 , n <= objects.length, +++n); for (i = 0 , i <= objects.length, ++i) { if (objects[j][n][i] && object[j][n][i].equals( "suedwest" )){ (neuewelt.addObject( new "suedwest" , 0 , 0 ) = newobject; newObject.setCellLocaation( 0 , 0 ); (object[j][n][i] && object[j][n][i] = "suedwest" ); } else { } |