Closed
Description
Version
Phaser 3.60 beta 18
Description
Emitter death zones are positioned in global space which is unexpected.
Was it an intentional change? It is quite confusing IMO because of the 2 reasons:
- in prior versions death zones were positioned in emitter local coordinates space
- emit zones & gravity wells are positioned in local space
Example Test Code
https://codesandbox.io/s/particles-death-zone-qpmvhn
let particles = this.add.particles(300, 300, "flares", {
lifespan: 1500,
alpha: { start: 0, end: 1 },
scale: 0.2,
quantity: 20,
emitting: false,
})
// emit zone position is in local emitter space (as expected)
let emitZone = new Phaser.Geom.Circle(0, 0, 200)
particles.addEmitZone({
source: emitZone,
type: "random",
quantity: -1,
})
// deathZone position is in global space
let deathZone = new Phaser.Geom.Circle(0, 0, 100)
// you need to manually calculate the offset to put it in the right place
// let deathZone = new Phaser.Geom.Circle(particles.x, particles.y, 100)
particles.addDeathZone({
source: deathZone,
type: "onEnter",
})
particles.start(1500)