Group

arcade.Group (Class)
Implements: Collidable

A Group is a container for multiple physics bodies. Groups can be used for efficient collision detection between sets of bodies.

Instance Members

arcade
objects: Array<Body>

Array of Body objects contained in this group.


arcade
sortDirection: SortDirection

The sorting direction for bodies in this group.


arcade
add(body: Body): Void

Adds a body to this group.

Name Type Description
body Body The body to add to the group.

arcade
remove(body: Body): Void

Removes a body from this group.

Name Type Description
body Body The body to remove from the group.

arcade
sortLeftRight(): Void

Sorts the bodies in this group from left to right based on their x position.


arcade
sortRightLeft(): Void

Sorts the bodies in this group from right to left based on their x position.


arcade
sortTopBottom(): Void

Sorts the bodies in this group from top to bottom based on their y position.


arcade
sortBottomTop(): Void

Sorts the bodies in this group from bottom to top based on their y position.


arcade
new(): Void