Type Function Object ParticleSystem Library physics.* Return value Number Revision Release 2024.3703 Keywords destroyParticles, physics, LiquidFun See also object:createGroup() object:createParticle()
This function is used to remove all particles within a region. It will return a number indicating how many particles were destroyed.
ParticleSystem:destroyParticles( params )
Table. A table that specifies the region of particles to destroy — see the next section for valid entries.
Number. The x position of the destruction region, in content space.
Number. The y position of the destruction region, in content space.
Number. The starting angle (rotation) of the destruction region.
Number. Half the width of the desired rectangular destruction region.
Number. Half the height of the desired rectangular destruction region.
Number. Radius of the desired circular destruction region.
Array. Array of up to eight x and y coordinates to generate an arbitrary convex destruction region.
local number_of_particles_destroyed = ParticleSystem:destroyParticles( { x = 123, y = 456, angle = 45, halfWidth = 16, halfHeight = 16 } )