| Package | org.flintparticles.twoD.zones |
| Class | public class MultiZone |
| Inheritance | MultiZone Object |
| Implements | Zone2D |
| Method | Defined By | ||
|---|---|---|---|
The constructor defines a MultiZone zone. | MultiZone | ||
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 | ||
| MultiZone | () | Constructor |
public function MultiZone()The constructor defines a MultiZone zone.
| addZone | () | method |
public function addZone(zone:Zone2D):voidThe 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):BooleanManages 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.
|
Boolean — Whether a collision occured.
|
| contains | () | method |
public function contains(x:Number, y:Number):BooleanDetermines 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.
|
Boolean — true if point is inside the zone, false if it is outside.
|
| getArea | () | method |
public function getArea():NumberReturns the size of the zone. This method is used by the MultiZone class to manage the balancing between the different zones.
ReturnsNumber — the size of the zone.
|
| getLocation | () | method |
public function getLocation():PointReturns 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.
ReturnsPoint — a random point inside the zone.
|
| removeZone | () | method |
public function removeZone(zone:Zone2D):voidThe removeZone method is used to remove a zone from this MultiZone object.
Parameters
zone:Zone2D — The zone you want to add.
|