examples/threaded-noise/noise-worker.js
function(dimensions) {
   var simplex = new gamejs.math.noise.Simplex(Math);
   var surfaceData = [];
   for (var i=0;i<dimensions[0];i++) {
      surfaceData[i] = [];
      for (var j=0;j<dimensions[1];j++) {
         var val = simplex.get(i/50, j/50) * 255;
         surfaceData[i][j] = val;
      }
   }
   return surfaceData;
}
function(dimensions) {
   var simplex = new gamejs.math.noise.Simplex(Math);
   var surfaceData = [];
   for (var i=0;i<dimensions[0];i++) {
      surfaceData[i] = [];
      for (var j=0;j<dimensions[1];j++) {
         var val = simplex.get(i/50, j/50) * 255;
         surfaceData[i][j] = val;
      }
   }
   return surfaceData;
}
function ( dimensions ) { var simplex = new gamejs . math . noise . Simplex ( Math ) ; var surfaceData = [ ] ; for ( var i = 0 ; i < dimensions [ 0 ] ; i ++ ) { surfaceData [ i ] = [ ] ; for ( var j = 0 ; j < dimensions [ 1 ] ; j ++ ) { var val = simplex . get ( i / 50 , j / 50 ) * 255 ; surfaceData [ i ] [ j ] = val ; } } return surfaceData ; }
create array with noise data to display
create array with noise data to display