Constructor
new Space()
Creates a new instance of the Space class.
- Source:
Members
(static, constant) ANY :number
Bit field indicating any, or all orthogonal directions.
Type:
- number
- Default Value:
- 0x1111
- Source:
(static, constant) DOWN :number
Bit field indicating the orthogonal direction down.
Type:
- number
- Default Value:
- 0x1000
- Source:
(static, constant) LEFT :number
Bit field indicating the orthogonal direction left.
Type:
- number
- Default Value:
- 0x0001
- Source:
(static, constant) NONE :number
Indicates no direction.
Type:
- number
- Default Value:
- 0x0000
- Source:
(static, constant) RIGHT :number
Bit field indicating the orthogonal direction right.
Type:
- number
- Default Value:
- 0x0010
- Source:
(static, constant) UP :number
Bit field indicating the orthogonal direction up.
Type:
- number
- Default Value:
- 0x0100
- Source:
Methods
(static) separate(obj1, obj2) → {boolean}
Resolves collision between two objects based on their physical properties.
The objects are separated in both x and y directions.
Parameters:
Name | Type | Description |
---|---|---|
obj1 |
rune.display.InteractiveObject | The first object. |
obj2 |
rune.display.InteractiveObject | The second object. |
- Source:
Returns:
If the objects were separated.
- Type
- boolean
(static) separateX(obj1, obj2) → {boolean}
Resolves collision between two objects, but only in x direction. The y
coordinates of the objects will not change.
Parameters:
Name | Type | Description |
---|---|---|
obj1 |
rune.display.InteractiveObject | The first object. |
obj2 |
rune.display.InteractiveObject | obj2 The second object. |
- Source:
Returns:
If the objects were separated.
- Type
- boolean
(static) separateY(obj1, obj2) → {boolean}
Resolves collision between two objects, but only in y direction. The x
coordinates of the objects will not change.
Parameters:
Name | Type | Description |
---|---|---|
obj1 |
rune.display.InteractiveObject | The first object. |
obj2 |
rune.display.InteractiveObject | The second object. |
- Source:
Returns:
If the objects were separated.
- Type
- boolean