-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add layer collider configuration (#586)
This PR allows users to deeply configure the collision behavior on tiled layers Given a Tiled tile layer name or id you can configure 1. Whether to use tile colliders regardless of solid=true|false 2. Whether to use the tile colliders when the layer is not visible 3. Force a layer to be solid or not overriding anything specified in tiled 4. Add a collision group to use for the tile layer ```typescript const tiledMap = new TiledResource('./orthogonal.tmx', { useMapBackgroundColor: true, layerConfig: { "Above": { isSolid: true useTileColliders: true, //useTileCollidersWhenInvisible: true, // use this instead of above usually collisionGroup: new ex.CollisionGroup("above", 0x01, 0x00111) } } }); ``` ![image](https://github.com/user-attachments/assets/e1579ba2-9be6-4754-a8b2-e5046ca10a31)
- Loading branch information
Showing
7 changed files
with
135 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.