text: class PlayerArrow {
    constructor(x, y, width, height, archerAngle) {
      var options = {
        isStatic: true,
        density: 0.1
      };
      this.width = width;
      this.height = height;
      this.body = Bodies.rectangle(x, y, this.width, this.height, options);
      this.image = loadImage("./assets/arrow.png");
      this.archerAngle = archerAngle;
      this.velocity = 0;
      World.add(world, this.body);
    }
    
    //create a shoot function
   
  
    display() {
    
      var pos = this.body.position;
      var angle = this.body.angle;
  
      push();
      translate(pos.x, pos.y);
      rotate(angle);
      imageMode(CENTER);
      image(this.image, 0, 0, this.width, this.height);
      pop();
    }
  
    shoot(archerAngel){
      archerAngel += 90;
      this.velocity = p5.Vector.fromAngel(archerAngle*(3.14 / 140));
  
      this.velocity.mult(0.5);
  
      Matter .Body.setVelocity(this.body, {
        x: thisVelocity.x * (180 / 3.14),
        y: thisVelocity.y * (180 / 3.14)
      });
  
      Matter.Body.setStatic(this.body, false)
  
      if(keyCode === 32){
        arrow.shoot(playerArcher.body.angle);
      }
    }
  }
  