ninis.js
function createNoGoCircleSpecialAttractors(x, y, radius, impactDistance, type, direction) {
  var circleSubDiv = radius * SUBDIVISE_NOGO / 20;
  for( var i = 0; i < circleSubDiv; i++ ) {
    var specialAttractor = {};
    specialAttractor.x1 = (x + radius * Math.cos(2*Math.PI / circleSubDiv * i)) * pixelRatio;
    specialAttractor.y1 = (y + radius * Math.sin(2*Math.PI / circleSubDiv * i)) * pixelRatio;
    specialAttractor.x2 = (x + radius * Math.cos(2*Math.PI / circleSubDiv * (i+1))) * pixelRatio;
    specialAttractor.y2 = (y + radius * Math.sin(2*Math.PI / circleSubDiv * (i+1))) * pixelRatio;
    specialAttractor.impactDistance = impactDistance * pixelRatio;
    specialAttractor.type = type;
    specialAttractor.direction = direction;
    specialAttractors.push(specialAttractor);
    if(DEBUG_FLAG) {
      drawHelperCircle(specialAttractor.x1, specialAttractor.y1, 1);
    }
  }

  var bbox = {
    topLeft: {
      x: (x - radius) * pixelRatio,
      y: (y - radius) * pixelRatio,
    },
    bottomRight: {
      x: (x + radius) * pixelRatio,
      y: (y + radius) * pixelRatio,
    },
  };

  specialAttractorsBoundingBoxes.push(bbox);
  noGoBBoxes.push(bbox);
}
function createNoGoCircleSpecialAttractors(x, y, radius, impactDistance, type, direction) {
  var circleSubDiv = radius * SUBDIVISE_NOGO / 20;
  for( var i = 0; i < circleSubDiv; i++ ) {
    var specialAttractor = {};
    specialAttractor.x1 = (x + radius * Math.cos(2*Math.PI / circleSubDiv * i)) * pixelRatio;
    specialAttractor.y1 = (y + radius * Math.sin(2*Math.PI / circleSubDiv * i)) * pixelRatio;
    specialAttractor.x2 = (x + radius * Math.cos(2*Math.PI / circleSubDiv * (i+1))) * pixelRatio;
    specialAttractor.y2 = (y + radius * Math.sin(2*Math.PI / circleSubDiv * (i+1))) * pixelRatio;
    specialAttractor.impactDistance = impactDistance * pixelRatio;
    specialAttractor.type = type;
    specialAttractor.direction = direction;
    specialAttractors.push(specialAttractor);
    if(DEBUG_FLAG) {
      drawHelperCircle(specialAttractor.x1, specialAttractor.y1, 1);
    }
  }

  var bbox = {
    topLeft: {
      x: (x - radius) * pixelRatio,
      y: (y - radius) * pixelRatio,
    },
    bottomRight: {
      x: (x + radius) * pixelRatio,
      y: (y + radius) * pixelRatio,
    },
  };

  specialAttractorsBoundingBoxes.push(bbox);
  noGoBBoxes.push(bbox);
}
function createNoGoCircleSpecialAttractors ( x , y , radius , impactDistance , type , direction ) { var circleSubDiv = radius * SUBDIVISE_NOGO / 20 ; for ( var i = 0 ; i < circleSubDiv ; i ++ ) { var specialAttractor = { } ; specialAttractor . x1 = ( x + radius * Math . cos ( 2 * Math . PI / circleSubDiv * i ) ) * pixelRatio ; specialAttractor . y1 = ( y + radius * Math . sin ( 2 * Math . PI / circleSubDiv * i ) ) * pixelRatio ; specialAttractor . x2 = ( x + radius * Math . cos ( 2 * Math . PI / circleSubDiv * ( i + 1 ) ) ) * pixelRatio ; specialAttractor . y2 = ( y + radius * Math . sin ( 2 * Math . PI / circleSubDiv * ( i + 1 ) ) ) * pixelRatio ; specialAttractor . impactDistance = impactDistance * pixelRatio ; specialAttractor . type = type ; specialAttractor . direction = direction ; specialAttractors . push ( specialAttractor ) ; if ( DEBUG_FLAG ) { drawHelperCircle ( specialAttractor . x1 , specialAttractor . y1 , 1 ) ; } } var bbox = { topLeft : { x : ( x - radius ) * pixelRatio , y : ( y - radius ) * pixelRatio , } , bottomRight : { x : ( x + radius ) * pixelRatio , y : ( y + radius ) * pixelRatio , } , } ; specialAttractorsBoundingBoxes . push ( bbox ) ; noGoBBoxes . push ( bbox ) ; }
Creates a circular no go zone
Creates a circular no go zone