Packageorg.flintparticles.twoD.actions
Classpublic class DeathZone
InheritanceDeathZone Inheritance ActionBase Inheritance Object

The DeathZone action marks the particle as dead if it is inside a specific zone. This action has a priority of -20, so that it executes after all movement has occured.

Default MXML Propertyzone



Public Properties
 PropertyDefined By
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
  zone : Zone2D
The zone.
DeathZone
  zoneIsSafe : Boolean
If true, the zone is treated as the safe area and particles ouside the zone are killed.
DeathZone
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
DeathZone(zone:Zone2D = null, zoneIsSafe:Boolean = false)
The constructor creates a DeathZone action for use by an emitter.
DeathZone
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Checks whether the particle is inside the zone and kills it if it is in the DeathZone region.
DeathZone
Property Detail
zoneproperty
zone:Zone2D

The zone.


Implementation
    public function get zone():Zone2D
    public function set zone(value:Zone2D):void
zoneIsSafeproperty 
zoneIsSafe:Boolean

If true, the zone is treated as the safe area and particles ouside the zone are killed. If false, particles inside the zone are killed.


Implementation
    public function get zoneIsSafe():Boolean
    public function set zoneIsSafe(value:Boolean):void
Constructor Detail
DeathZone()Constructor
public function DeathZone(zone:Zone2D = null, zoneIsSafe:Boolean = false)

The constructor creates a DeathZone action for use by an emitter. To add a DeathZone to all particles created by an emitter, use the emitter's addAction method.

Parameters
zone:Zone2D (default = null) — The zone to use. Any item from the org.flintparticles.twoD.zones package can be used.
 
zoneIsSafe:Boolean (default = false) — If true, the zone is treated as the safe area and particles outside the zone are killed. If false, particles inside the zone are killed.

See also

Method Detail
update()method
override public function update(emitter:Emitter, particle:Particle, time:Number):void

Checks whether the particle is inside the zone and kills it if it is in the DeathZone region.

This method is called by the emitter and need not be called by the user.

Parameters

emitter:Emitter — The Emitter that created the particle.
 
particle:Particle — The particle to be updated.
 
time:Number — The duration of the frame - used for time based updates.

See also