title: JS game - shooting in random directions
body: <p>I am working on a HTML5 canvas / Javascript based game. It is a fighter jet game, after I pass specific score my main boss will spawn. Everything works like I wanted to but, I dont how to do boss shooting. My jet fires a single bullet verticaly but my idea was to make the boss fire in random directions. At least 3 bullets at the same time, in diferent directions. I am not using jQuery at all just normal JS. Boss moves horizontaly from border to another border, but its not shooting, so I might need a little bit of help. Any ideas ? </p>
  
  <p><img src="https://i.stack.imgur.com/notUA.jpg" alt="enter image description here"></p>
  
  <p>Red lines are my idea of shooting. I am capable of checking bullet / jet collision.</p>
  
  <p>Some code of boss (vertical) shooting.</p>
  
  <pre><code>function BossBullet() {
      this.srcX = 1304;
      this.srcY = 0;
      this.drawX = 500;
      this.drawY = 0;
      this.width = 4;
      this.height = 16;
  }
  
  BossBullet.prototype.akt = function(X,Y) {
  
      this.noseX=X;
      this.noseY=Y;
  };
  
  BossBullet.prototype.draw = function() {
      ctxBullet.clearRect(0, 0, gameWidth, gameHeight);
      this.drawY += 10;
  
      ctxBullet.drawImage(imgSprite, this.srcX, this.srcY, this.width, this.height, this.drawX, this.drawY, this.width, this.height);
     //strela[hudba].play();
      if (this.drawY &gt; 700) {
          this.drawY= this.noseY;
          this.drawX= this.noseX;
  
      }
  };
  </code></pre>
  
  <p>and this is how it looks like. It fires single bullet from bosses nose and goes down until it reaches its Y value 0 and respawns. </p>
  
  <p><img src="https://i.stack.imgur.com/QTOx3.jpg" alt="enter image description here"></p>
  
  <p>I tried to add to <code>this.drawY += 10;</code> also <code>this.drawX += 1;</code> but this way it doesnt move at all.
  Any ideas how to change the directory of the bullet?? </p>