From f2caab469198fe33649b487546fb5d8e12007296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gilles=20Roudi=C3=A8re?= Date: Wed, 15 Sep 2021 15:23:58 +0200 Subject: Improve TileMap physics for moving platforms and conveyor belts like movements --- doc/classes/TileData.xml | 30 ++++++++++++++++++++++++++++++ doc/classes/TileMap.xml | 18 ++++++++++++++++++ 2 files changed, 48 insertions(+) (limited to 'doc/classes') diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml index 0d3282c6d3..81c5743ccc 100644 --- a/doc/classes/TileData.xml +++ b/doc/classes/TileData.xml @@ -37,6 +37,20 @@ Returns how many polygons the tile has for TileSet physics layer with index [code]layer_id[/code]. + + + + + Returns the constant angular velocity applied to objects colliding with this tile. + + + + + + + Returns the constant linear velocity applied to objects colliding with this tile. + + @@ -123,6 +137,22 @@ Sets the polygons count for TileSet physics layer with index [code]layer_id[/code]. + + + + + + Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile. + + + + + + + + Sets the constant linear velocity. This does not move the tile. This linear velocity is applied to objects colliding with this tile. This is useful to create conveyor belts. + + diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 4621d138ac..e5fe823be6 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -29,6 +29,13 @@ Clears all cells. + + + + + Clears all cells on the given layer. + + @@ -62,6 +69,13 @@ Returns the tile source ID of the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. If [code]use_proxies[/code] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. + + + + + Returns the coodinates of the tile for given physics body RID. Such RID can be retrieved from [member KinematicCollision2D.collider_rid], when colliding with a tile. + + @@ -220,6 +234,10 @@ The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. + + If enabled, the TileMap will see its collisions synced to the physics tick and change its collision type from static to kinematic. This is required to create TileMap-based moving platform. + [b]Note:[/b] Enabling [code]collision_animatable[/code] may have a small performance impact, only do it if the TileMap is moving and has colliding tiles. + Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show collision debug settings. -- cgit v1.2.3