Hi! I try to extend class Phaser.Curves.Line but the line not render, the consolo log don´t report any error, can you help me? thanks in Advanced.
// START Extend Curve Line
class NewCurveLine extends Phaser.Curves.Line {
constructor(config, name) {
super(config.p0, config.p1, config.p0, config.p1);
this.name = name;
// Add the class to the scene
config.scene.add.existing(this);
}
setName(name) {
return this.name;
}
getName(name) {
return this.name;
}
} // END Extend Curve Line
function drawCurveLine() {
graphicsCurveLineA = this.add.graphics({
lineStyle: { width: 2, color: 0xff0000 },
fillStyle: { color: 0xff0000 }
});
curveLineA = new NewCurveLine({
scene: this,
p0: 150,
p1: 100,
p0: 250,
p1: 500,
name: 'curveLineA'
});
// var curve = new Phaser.Curves.Line(new Phaser.Math.Vector2(100, 100), new Phaser.Math.Vector2(200, 500));
graphicsCurveLineA.lineStyle(2, 0x0000ff, 1);
curveLineA.draw(graphicsCurveLineA);
}