function Bullet(position, velocity, angle, canvas) {
  this.worldWidth = canvas.width;
  this.worldHeight = canvas.height;
  this.position = {
    x: position.x,
    y: position.y
  };
  
  this.velocity = {
    x: velocity.y*Math.sin(angle)-velocity.x * Math.cos(angle),
    y: velocity.y * Math.cos(angle) + velocity.x*Math.sin(angle)
  }
  this.radius = 3;
  this.color="white";
  this.id="bullet";
  this.index=0;
  this.angle = angle;
}
/**
 * @constructor Bullet
 * Creates a new Bullet object
 * @param {Postition} position object specifying an x and y
 */
@constructor Bullet
Creates a new Bullet object
@param {Postition} position object specifying an x and y
@constructor Bullet Creates a new Bullet object @param { Postition } position object specifying an x and y
function Bullet(position, velocity, angle, canvas) {
  this.worldWidth = canvas.width;
  this.worldHeight = canvas.height;
  this.position = {
    x: position.x,
    y: position.y
  };
  this.velocity = {
    x: velocity.y*Math.sin(angle)-velocity.x * Math.cos(angle),
    y: velocity.y * Math.cos(angle) + velocity.x*Math.sin(angle)
  }
  this.radius = 3;
  this.color="white";
  this.id="bullet";
  this.index=0;
  this.angle = angle;
}
function Bullet ( position , velocity , angle , canvas ) { this . worldWidth = canvas . width ; this . worldHeight = canvas . height ; this . position = { x : position . x , y : position . y } ; this . velocity = { x : velocity . y * Math . sin ( angle ) - velocity . x * Math . cos ( angle ) , y : velocity . y * Math . cos ( angle ) + velocity . x * Math . sin ( angle ) } this . radius = 3 ; this . color = "white" ; this . id = "bullet" ; this . index = 0 ; this . angle = angle ; }
@constructor Bullet
 Creates a new Bullet object
 @param {Postition} position object specifying an x and y
@constructor Bullet Creates a new Bullet object @param { Postition } position object specifying an x and y