Beispiel #1
0
   this.draw = function(display) {
      var x, y;
      var color = null;
      var m = null;
      for (var i=0; i<H; i++) {
         for (var j=0; j<W; j++) {
            m = map[i][j];
            if (m.modified === true) {
               color = [255, 100, 255];
               if (m.alive === false) {
                  color = [255, 255, 255];
               }
               y = i * CELL_SIZE;
               x = j * CELL_SIZE;
               srfarray.set(x, y, color);
               srfarray.set(x-1, y-1, color);
               srfarray.set(x+1, y+1, color);
               srfarray.set(x-1, y+1, color);
               srfarray.set(x+1, y-1, color);

            }
         }
      }
      blitArray(display, srfarray);
   };
Beispiel #2
0
    var tick = function (msDuration) {
        controller.update(msDuration);
        surfaceArray.blitArray(disp, debugRenderer.sfArray);
        controller.draw(disp, draw, otus);
        debugRenderer.drawLevelRects(disp,bush);
	
    
    };