Module providing support for sprite collisions.
- Source:
Classes
Type Definitions
Collider
Object involved in collisions.
Type:
- Object
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
sprite |
module:hcje/sprites.Sprite | the sprite that is colliding. |
|
shrinkage |
module:hcje/utils~Shrinkage |
<optional> |
shrinkage to apply to derive collision rectangle. |
callback |
module:hcje/collisions~notifyCollision |
<optional> |
function to call when collision is detected. |
- Source:
notifyCollision(masterSprite, otherSprite)
Function that is called when a collision has been detected.
Parameters:
| Name | Type | Description |
|---|---|---|
masterSprite |
module:hcje/sprites.Sprite | the sprite that detected the collision. |
otherSprite |
module:hcje/sprites.Sprite | the other sprite involved in the collision. |
- Source: