Hi,
In the documentation of the Weapon, the property bulletClass speak the follow:
bulletClass : Object => "The Class of the bullets that are launched by this Weapon. Defaults Phaser.Bullet, but can be overridden before calling createBullets and set to your own class type."
that could be written:
class MyWeapon extens Phaser.Weapon {
contructor(){
super();
this.bulletClass = MyBulletClass; /*error here*/
this.createBullets(30, imgSprite);
}
}
the problem is that que the method bulletClass executes internally the code:
https://github.com/photonstorm/phaser/blob/v2.6.2/src/plugins/weapon/WeaponPlugin.js#L1130
this.bullets.classType = this._bulletClass;
But this.bullets still not was instantiate(null), so throws the error "can not read property 'classType' of undefined".
If i comments the line, everything works.
Would this line really necessary?
I'm using Phaser 2.6.2.