做了一个黄金矿工小游戏,希望在夹子发射和回收的时候展示被伸长的绳索。
现在用的是在create里添加graphics ,然后在update里画线,但是夹子回收的时候不知道该怎么处理
当然也不局限于使用graphics,如果您有更好的方法也可以提出来让我学习一下
create{
this.graphics = this.add.graphics();
this.graphics.lineStyle(2, 0xff00ff, 1.0);
}
update{
this.graphics.moveTo(this.x, this.y);
this.graphics.lineTo(this.player.x, this.player.y);
this.graphics.strokePath();
}