title: Shoot 3 bullets on set times from each enemy
body: <p>I'm trying to create a simple game with kineticJS on my canvas(Just some practice) and managed to get my player to shoot bullets. The same goes for the enemies that are spawned. They shoot a bullet each time the last bullet leaves the stage.</p>
  
  <p>However: I'd like all the enemies(Variable number) to shoot 3 bullets at a 2 seconds interval. But i'm stuck completely and can't figure a way how to get it done.</p>
  
  <p>Could anyone please look at my fiddle and see what's up?
  <a href="http://jsfiddle.net/eRQ3P/6/" rel="nofollow">http://jsfiddle.net/eRQ3P/6/</a></p>
  
  <p>Note: line 573 is the function that loops(And draws the bullets and such every 30FPS)</p>
  
  <p>Here's the code where i create a new bullet object:(Line 406 in fiddle)</p>
  
  <pre><code>function Enemybullet(destinationX, destinationY, enemySprite) {
  
      this.id = 'bullet';
      this.x = enemySprite.getX()+(enemySprite.getWidth()/2);
      this.y = enemySprite.getY()+(enemySprite.getHeight()/2);
  
      var targetX = destinationX - this.x,
          targetY = destinationY - this.y,
          distance = Math.sqrt(targetX * targetX + targetY * targetY);
  
      this.velX = (targetX / distance) * 5;
      this.velY = (targetY / distance) * 5;
  
      this.finished = false;
  
      this.sprite = new Kinetic.Circle({
          x: this.x,
          y: this.y, 
          radius: 3,
          fill: 'black',
          name: 'enemyProjectile'
      });
  
      this.draw = function(index) {
  
          var mayDelete = false;
  
          this.x += this.velX;
          this.y += this.velY;
  
          this.sprite.setAbsolutePosition(this.x, this.y);
          //console.log(this.sprite.getX());
  
  /*
          if(enemyCollision(this) == true) {
              mayDelete = true;
          }*/
  
          if (bulletLeftField(this.sprite) == true) {
              mayDelete = true;
          }
  
          if (mayDelete == true) {
              this.sprite.remove();
              enemies[index].bullets.splice(0, 1);
              createEnemyBullet(enemies[index]);
          }
  
  
  
          ammoLayer.draw();
      }
  }
  </code></pre>
  
  <p>And the function providing a new bullet: (line 247 in fiddle)</p>
  
  <pre><code>function createEnemyBullet(enemy) {
      var blt = new Enemybullet(player.sprite.getX(), player.sprite.getY(), enemy.sprite);
      ammoLayer.add(blt.sprite);
      enemy.bullets.push(blt);
  }
  </code></pre>