Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Adventure Bird on August 13, 2010, 04:57:38 PM
-
It's long time ago since I used my last 3D array that uses normal arrays.
Maybe somebody could help me.
Here is the code:
var Spielfeld;
function initSpielfeld()
{
Spielfeld = new Array(15);
for ( var x = 1; x <= 15; x=x+1)
{
Spielfeld[x] = new Array(12);
for( var y = 1; y <= 3; y=y+1 )
{
Spielfeld[x][y] = new Array(3); // HERE is the problem with the two brackets
for (var z = 1; z <= 12; z=z+1 )
{
Spielfeld[x][y][z] = 0;
}
}
}
}
-
use tmp variable
var tmp = spiel[x];
tmp[x] = 17;
spiel[x] = tmp;
-
Thanks a lot.