Packageorg.flintparticles.twoD.zones
Classpublic class MultiZone
InheritanceMultiZone Inheritance Object
Implements Zone2D

The MutiZone zone defines a zone that combines other zones into one larger zone.



Public Methods
 MethodDefined By
  
The constructor defines a MultiZone zone.
MultiZone
  
addZone(zone:Zone2D):void
The addZone method is used to add a zone into this MultiZone object.
MultiZone
  
collideParticle(particle:Particle2D, bounce:Number = 1):Boolean
Manages collisions between a particle and the zone.
MultiZone
  
contains(x:Number, y:Number):Boolean
Determines whether a point is inside the zone.
MultiZone
  
getArea():Number
Returns the size of the zone.
MultiZone
  
getLocation():Point
Returns a random point inside the zone.
MultiZone
  
removeZone(zone:Zone2D):void
The removeZone method is used to remove a zone from this MultiZone object.
MultiZone
Constructor Detail
MultiZone()Constructor
public function MultiZone()

The constructor defines a MultiZone zone.

Method Detail
addZone()method
public function addZone(zone:Zone2D):void

The addZone method is used to add a zone into this MultiZone object.

Parameters

zone:Zone2D — The zone you want to add.

collideParticle()method 
public function collideParticle(particle:Particle2D, bounce:Number = 1):Boolean

Manages collisions between a particle and the zone. This method handles altering the particle's position and velocity in response to the collision.

Parameters

particle:Particle2D — The particle to be tested for collision with the zone.
 
bounce:Number (default = 1) — The coefficient of restitution for the collision.

Returns
Boolean — Whether a collision occured.
contains()method 
public function contains(x:Number, y:Number):Boolean

Determines whether a point is inside the zone. This method is used by the initializers and actions that use the zone. Usually, it need not be called directly by the user.

Parameters

x:Number — The x coordinate of the location to test for.
 
y:Number — The y coordinate of the location to test for.

Returns
Boolean — true if point is inside the zone, false if it is outside.
getArea()method 
public function getArea():Number

Returns the size of the zone. This method is used by the MultiZone class to manage the balancing between the different zones.

Returns
Number — the size of the zone.
getLocation()method 
public function getLocation():Point

Returns a random point inside the zone. This method is used by the initializers and actions that use the zone. Usually, it need not be called directly by the user.

Returns
Point — a random point inside the zone.
removeZone()method 
public function removeZone(zone:Zone2D):void

The removeZone method is used to remove a zone from this MultiZone object.

Parameters

zone:Zone2D — The zone you want to add.