examples/3d/js/map.js
function(secs) {
    if (this.light > 0) {
      this.light = Math.max(this.light - 10 * secs, 0);
    } else if (Math.random() * 6 < secs) {
      this.light = 2;

      // Play the lightning sound.
      game.audio.lightning();
    }
  }
function(secs) {
    if (this.light > 0) {
      this.light = Math.max(this.light - 10 * secs, 0);
    } else if (Math.random() * 6 < secs) {
      this.light = 2;

      // Play the lightning sound.
      game.audio.lightning();
    }
  }
function ( secs ) { if ( this . light > 0 ) { this . light = Math . max ( this . light - 10 * secs , 0 ) ; } else if ( Math . random ( ) * 6 < secs ) { this . light = 2 ; // Play the lightning sound. game . audio . lightning ( ) ; } }
Update loop on the map, in this case used to add in lightning by adjusting global lighting.
@param  {Number} secs Seconds since last tick.
Update loop on the map in this case used to add in lightning by adjusting global lighting .