PlatformWorld
Description:
A class representing a 2D platformer game world with physics simulations.
Class Object: Platformer.PlatformWorld Class.
Inherits from: PhysicsWorld.
camera
Type: Readonly Field.
Description:
The camera used to control the view of the game world.
Signature:
const camera: PlatformCamera
moveChild
Type: Function.
Description:
Moves a child node to a new order for a different layer.
Signature:
moveChild: function(self: PlatformWorld, child: Node, newOrder: integer)
Parameters:
Parameter | Type | Description |
---|---|---|
child | Node | The child node to be moved. |
newOrder | integer | The new order of the child node. |
getLayer
Type: Function.
Description:
Gets the layer node at a given order.
Signature:
getLayer: function(self: PlatformWorld, order: integer): Node
Parameters:
Parameter | Type | Description |
---|---|---|
order | integer | The order of the layer node to get. |
Returns:
Return Type | Description |
---|---|
Node | The layer node at the given order. |
setLayerRatio
Type: Function.
Description:
Sets the parallax moving ratio for a given layer to simulate 3D projection effect.
Signature:
setLayerRatio: function(self: PlatformWorld, order: integer, ratio: Vec2)
Parameters:
Parameter | Type | Description |
---|---|---|
order | integer | The order of the layer to set the ratio for. |
ratio | Vec2 | The new parallax ratio for the layer. |
getLayerRatio
Type: Function.
Description:
Gets the parallax moving ratio for a given layer.
Signature:
getLayerRatio: function(self: PlatformWorld, order: integer): Vec2
Parameters:
Parameter | Type | Description |
---|---|---|
order | integer | The order of the layer to get the ratio for. |
Returns:
Return Type | Description |
---|---|
Vec2 | The parallax ratio for the layer. |
setLayerOffset
Type: Function.
Description:
Sets the position offset for a given layer.
Signature:
setLayerOffset: function(self: PlatformWorld, order: integer, offset: Vec2)
Parameters:
Parameter | Type | Description |
---|---|---|
order | integer | The order of the layer to set the offset for. |
offset | Vec2 | The new position offset for the layer. |
getLayerOffset
Type: Function.
Description:
Gets the position offset for a given layer.
Signature:
getLayerOffset: function(self: PlatformWorld, order: integer): Vec2
Parameters:
Parameter | Type | Description |
---|---|---|
order | integer | The order of the layer to get the offset for. |
Returns:
Return Type | Description |
---|---|
Vec2 | The position offset for the layer. |
swapLayer
Type: Function.
Description:
Swaps the positions of two layers.
Signature:
swapLayer: function(self: PlatformWorld, orderA: integer, orderB: integer)
Parameters:
Parameter | Type | Description |
---|---|---|
orderA | integer | The order of the first layer to swap. |
orderB | integer | The order of the second layer to swap. |
removeLayer
Type: Function.
Description:
Removes a layer from the game world.
Signature:
removeLayer: function(self: PlatformWorld, order: integer)
Parameters:
Parameter | Type | Description |
---|---|---|
order | integer | The order of the layer to remove. |
removeAllLayers
Type: Function.
Description:
Removes all layers from the game world.
Signature:
removeAllLayers: function(self: PlatformWorld)