API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classDeathModule

@codexo/exojs-particles / particles / stable

Per-particle hook invoked exactly once when a particle expires, before its slot is recycled by the compaction pass. The dying particle's data is still readable at `system.posX[slot]` etc. Use for sub-emitters (spawn child particles where this one died), event dispatch (trigger an audio cue, score event), or trail termination. Implementation pattern: ```ts onDeath(system, slot) { const x = system.posX[slot]; const y = system.posY[slot]; this._childSystem.spawnBurstAt(x, y, 8); } ```

0
props
2
methods
0
events
Import
import { DeathModule } from '@codexo/exojs-particles'

Per-particle hook invoked exactly once when a particle expires, before its slot is recycled by the compaction pass. The dying particle's data is still readable at `system.posX[slot]` etc.

Use for sub-emitters (spawn child particles where this one died), event dispatch (trigger an audio cue, score event), or trail termination.

Implementation pattern:

```ts onDeath(system, slot) { const x = system.posX[slot]; const y = system.posY[slot]; this._childSystem.spawnBurstAt(x, y, 8); } ```

Constructors 1
new(): DeathModule
Methods 2
destroy(): void
onDeath(system: ParticleSystem, slot: number): void
Source