function Asteroid(position, canvas) {
  this.worldWidth = canvas.width;
  this.worldHeight = canvas.height;
  this.position = {
    x: position.x,
    y: position.y
  };
  
  this.velocity = {
    x: Math.random()  * (Math.random() < 0.5 ? -1 : 1),
    y: Math.random()  * (Math.random() < 0.5 ? -1 : 1)
  }
  this.radius = Math.random() * 10 + 35;
  this.color="white";
  this.id="asteroid";
  this.index=0;
}
/**
 * @constructor Asteroid
 * Creates a new Asteroid object
 * @param {Postition} position object specifying an x and y
 */
@constructor Asteroid
Creates a new Asteroid object
@param {Postition} position object specifying an x and y
@constructor Asteroid Creates a new Asteroid object @param { Postition } position object specifying an x and y
function Asteroid(position, canvas) {
  this.worldWidth = canvas.width;
  this.worldHeight = canvas.height;
  this.position = {
    x: position.x,
    y: position.y
  };
  this.velocity = {
    x: Math.random()  * (Math.random() < 0.5 ? -1 : 1),
    y: Math.random()  * (Math.random() < 0.5 ? -1 : 1)
  }
  this.radius = Math.random() * 10 + 35;
  this.color="white";
  this.id="asteroid";
  this.index=0;
}
function Asteroid ( position , canvas ) { this . worldWidth = canvas . width ; this . worldHeight = canvas . height ; this . position = { x : position . x , y : position . y } ; this . velocity = { x : Math . random ( ) * ( Math . random ( ) < 0.5 ? - 1 : 1 ) , y : Math . random ( ) * ( Math . random ( ) < 0.5 ? - 1 : 1 ) } this . radius = Math . random ( ) * 10 + 35 ; this . color = "white" ; this . id = "asteroid" ; this . index = 0 ; }
@constructor Asteroid
 Creates a new Asteroid object
 @param {Postition} position object specifying an x and y
@constructor Asteroid Creates a new Asteroid object @param { Postition } position object specifying an x and y