new CollisionSystem()
CollisionSystem system to handle collision within a map
- Source:
Members
collisionArray :Array
Array holding collision data
Type:
- Array
- Source:
Methods
checkCellValid(x, y) → {boolean}
Returns true if coordinate is valid
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | x-coordinate in pixels |
y |
number | y-coordinate in pixels |
- Source:
Returns:
- Type
- boolean
checkCellValidForObject(object) → {boolean}
Returns false if object intersects invalid tile
Parameters:
| Name | Type | Description |
|---|---|---|
object |
Object |
- Source:
Returns:
- Type
- boolean
checkCollisionCellValid(x, y) → {boolean}
Returns true if coordinate is valid
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | x-component in grid coordinates |
y |
number | y-component in grid coordinates |
- Source:
Returns:
- Type
- boolean
getCollisionCoordinateFromCell(x, y) → {Object}
Returns object with grid coordinates
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | |
y |
number |
- Source:
Returns:
- Type
- Object
simpleCollision(object1, object2) → {boolean}
Returns true if objects intersect
Parameters:
| Name | Type | Description |
|---|---|---|
object1 |
Object | |
object2 |
Object |
- Source:
Returns:
- Type
- boolean