Adds the given Collision Category to the list of those that this Arcade Physics Body will collide with.
The collision category to add to this body's collision mask.
This Game Object.
Removes the given Collision Category from the list of those that this Arcade Physics Body will collide with.
The collision category to remove from this body's collision mask.
This Game Object.
Resets the Collision Category and Mask back to the defaults, which means the body will belong to category 1 and will collide with all other categories.undefined
This Game Object.
Sets all of the Collision Categories that this Arcade Physics Body will collide with. You can either pass a single category value, or an array of them.
Calling this method will reset all of the collision categories, so only those passed to this method are enabled.
If you wish to add a new category to the existing mask, call
the addCollidesWith method.
If you wish to reset the collision category and mask, call
the resetCollisionCategory method.
The collision category to collide with, or an array of them.
This Game Object.
Sets the Collision Category that this Arcade Physics Body will use in order to determine what it can collide with.
It can only have one single category assigned to it.
If you wish to reset the collision category and mask, call
the resetCollisionCategory method.
The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on.
This Game Object.
Checks to see if the given Collision Category will collide with this Arcade Physics object or not.
Collision category value to test.
true if the given category will collide with this object, otherwise false.
Provides methods used for setting the collision category and mask of an Arcade Physics Body.
Collision categories and masks allow you to control which bodies interact with each other. Each body has a collision category (its "identity") and a collision mask (the set of categories it will collide with). Two bodies will only collide if each body's category is present in the other body's mask. By default, all bodies belong to category 1 and collide with all categories.