Hey y’all, I’m new to Phaser 3. I’ve managed to draw a path and I’ve gotten a sprite to follow it but I can’t seem to set any collisions with it? I’m not sure where I’m going wrong?
createMiniBoss() {
let path = new Phaser.Curves.Path(50, -50)
path.lineTo(50, 50)
path.lineTo(450, 50)
path.lineTo(450, 100)
path.lineTo(50, 100)
//... the path is longer
// let miniBoss = this.miniBoss.create(50, -50, 'mediumEnemy')
let miniBoss = this.add.follower(path, 50, -50, 'mediumEnemy')
miniBoss.setScale(2)
miniBoss.startFollow(20000)
let randomShootStart = Phaser.Math.RND.between(250, 750)
this.time.addEvent({
delay: randomShootStart,
callback: () => this.fireEnemyLaser(miniBoss),
repeat: -1,
})
this.time.addEvent({
delay: 20100,
callback: () => miniBoss.destroy(),
})
}
Thank you! The debugger helped a great deal. I was also misunderstanding how the object was being referenced in my code. I’m still very new to this and I really appreciate your help!