var path = new Phaser.Curves.Path(50, 500);
path.lineTo(500, 500);
path.lineTo(500, 100);
path.lineTo(50, 100);
path.lineTo(50, 500);
var graphics = this.add.graphics();
graphics.lineStyle(5, 0x00000, 5);
var enemy = this.add.follower(path, 50, 500, 'enemy').setScale(2, 2)
this.physics.add.existing(enemy).body.setSize(15, 20, false);
enemy.startFollow({
duration: 30000,
loop: -1,
onLoop() {
enemy.flipX = false
}
});
Is there any way to check if the follower has finished traversing a line? I want him to stop every time he finishes walking a line before going to the next