Hi everyone,
I'm following a tutorial about creating a shoot 'em up with Phaser but I got stuck when creating a power up that allows you to shoot multiple bullets at a time.
As Richard Davey says it should be as simple as calling the .fire() method multiple times but it doesn't work, only the first call to .fire() gets executed no matter what.
Here's my code:
for ( var i = 0; i < this.weaponLevel; i++ ) {
// Left bullets
var left = new Phaser.Point(this.player.position.x - 10*i, this.player.position.y - 20);
this.weapon.fireAngle = -95 - i*10;
this.weapon.fire(left);
// Right bullets
var right = new Phaser.Point(this.player.position.x + 10*i, this.player.position.y - 20);
this.weapon.fireAngle = -85 + i*10;
this.weapon.fire(right);
}
I've googled a lot and unfortunately I found nothing.
Thanks in advance.