You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* upgrade to bevy and bevy_ecs_tilemap 0.15 ([#340](https://github.com/Trouv/bevy_ecs_ldtk/issues/340))
9
+
10
+
### Features
11
+
12
+
* upgrade to bevy and bevy_ecs_tilemap 0.15 ([#340](https://github.com/Trouv/bevy_ecs_ldtk/issues/340)) ([f44a281](https://github.com/Trouv/bevy_ecs_ldtk/commit/f44a2814faf3f200232800aeb9e67f7c85f7278e))
13
+
14
+
15
+
### Documentation Changes
16
+
17
+
* refactor platformer example by topic ([#329](https://github.com/Trouv/bevy_ecs_ldtk/issues/329)) ([f59e5e5](https://github.com/Trouv/bevy_ecs_ldtk/commit/f59e5e588026922620c1981108828e1e3ae6153f))
Copy file name to clipboardExpand all lines: README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -30,13 +30,13 @@ For less common use cases, strategies that leverage this plugin's ECS constructs
30
30
31
31
## Documentation
32
32
Documentation for this plugin is available in two main places.
33
-
- API reference on [docs.rs](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/)<!-- x-release-please-version -->
34
-
- Tutorials, Explanation, and Guides in the [`bevy_ecs_ldtk` book](https://trouv.github.io/bevy_ecs_ldtk/v0.10.0/index.html)<!-- x-release-please-version -->
33
+
- API reference on [docs.rs](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/)<!-- x-release-please-version -->
34
+
- Tutorials, Explanation, and Guides in the [`bevy_ecs_ldtk` book](https://trouv.github.io/bevy_ecs_ldtk/v0.11.0/index.html)<!-- x-release-please-version -->
35
35
36
36
In the book, the following chapters are good jumping-off points for beginners:
Copy file name to clipboardExpand all lines: book/src/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Some resources for learning Bevy include those listed on the [Bevy website](http
32
32
LDtk also provides documentation on [its website](https://ldtk.io/docs/).
33
33
34
34
`bevy_ecs_ldtk`'s [source code](https://github.com/Trouv/bevy_ecs_ldtk) is available on github.
35
-
This repository also contains [cargo examples](https://github.com/Trouv/bevy_ecs_ldtk/tree/v0.10.0/examples), which can be run after cloning the repository using `$ cargo run --example example-name`. <!-- x-release-please-version -->
35
+
This repository also contains [cargo examples](https://github.com/Trouv/bevy_ecs_ldtk/tree/v0.11.0/examples), which can be run after cloning the repository using `$ cargo run --example example-name`. <!-- x-release-please-version -->
36
36
These examples may be difficult to follow on their own, and many of their strategies are described in this book.
37
37
When viewing these examples, be careful to checkout the correct git tag for the version of the plugin you are using.
38
38
Some changes may have been made to the plugin or to the examples on the `main` branch that are not released yet, and trying to apply these to the version of the plugin you are using can lead to errors.
Copy file name to clipboardExpand all lines: book/src/explanation/anatomy-of-the-world.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# Anatomy of the World
2
-
Once an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LdtkWorldBundle.html) is spawned, [levels are selected](level-selection.md), and the associated assets finish loading, the level spawning process begins. <!-- x-release-please-version -->
2
+
Once an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LdtkWorldBundle.html) is spawned, [levels are selected](level-selection.md), and the associated assets finish loading, the level spawning process begins. <!-- x-release-please-version -->
3
3
The result is a deeply nested hierarchy of entities which can be difficult to navigate, but predictable.
4
4
It can be useful to write code that makes assumptions about the relationships between `bevy_ecs_ldtk` entities.
5
5
To assist with this, this chapter will explain the anatomy of a `bevy_ecs_ldtk` world.
@@ -8,16 +8,16 @@ To assist with this, this chapter will explain the anatomy of a `bevy_ecs_ldtk`
8
8
The basic hierarchy of spawned entities and their identifying components/bundles are as follows.
9
9
This does exclude some special cases which are explained in more detail below.
10
10
Each bullet indent indicates a parent/child relationship.
11
-
- The world entity, with an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LdtkWorldBundle.html) bundle. <!-- x-release-please-version -->
12
-
- The level entities, with a [`LevelIid`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LevelIid.html) component. <!-- x-release-please-version -->
13
-
- For Entity layers - a layer entity with just a [`LayerMetadata`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
14
-
- LDtk Entity entities, with an [`EntityInstance`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/ldtk/struct.EntityInstance.html) component, or possibly others if you're using [`LdtkEntity` registration](game-logic-integration.html#ldtkentity-and-ldtkintcell-registration). <!-- x-release-please-version -->
15
-
- For Tile/AutoTile/IntGrid layers: `bevy_ecs_tilemap` tilemap entities, with a [`TilemapBundle`](https://docs.rs/bevy_ecs_tilemap/latest/bevy_ecs_tilemap/type.TilemapBundle.html)**and** a [`LayerMetadata`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
16
-
- For IntGrid layers - tile entities with an [`IntGridCell`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.IntGridCell.html) component, or possibly others if you're using [`LdtkIntCell` registration](game-logic-integration.html#ldtkentity-and-ldtkintcell-registration). <!-- x-release-please-version -->
11
+
- The world entity, with an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LdtkWorldBundle.html) bundle. <!-- x-release-please-version -->
12
+
- The level entities, with a [`LevelIid`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LevelIid.html) component. <!-- x-release-please-version -->
13
+
- For Entity layers - a layer entity with just a [`LayerMetadata`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
14
+
- LDtk Entity entities, with an [`EntityInstance`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/ldtk/struct.EntityInstance.html) component, or possibly others if you're using [`LdtkEntity` registration](game-logic-integration.html#ldtkentity-and-ldtkintcell-registration). <!-- x-release-please-version -->
15
+
- For Tile/AutoTile/IntGrid layers: `bevy_ecs_tilemap` tilemap entities, with a [`TilemapBundle`](https://docs.rs/bevy_ecs_tilemap/latest/bevy_ecs_tilemap/type.TilemapBundle.html)**and** a [`LayerMetadata`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
16
+
- For IntGrid layers - tile entities with an [`IntGridCell`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.IntGridCell.html) component, or possibly others if you're using [`LdtkIntCell` registration](game-logic-integration.html#ldtkentity-and-ldtkintcell-registration). <!-- x-release-please-version -->
17
17
- For Tile/AutoTile layers (or IntGrid layers with AutoTile functionality) - `bevy_ecs_tilemap` tile entities, with a [`TileBundle`](https://docs.rs/bevy_ecs_tilemap/latest/bevy_ecs_tilemap/tiles/struct.TileBundle.html) bundle.
18
18
19
19
## Worldly Entities
20
-
The [`LdtkEntity` derive macro](game-logic-integration.html#ldtkentity-and-ldtkintcell-registration) allows you to define entities as ["worldly"](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/app/trait.LdtkEntity.html#worldly). <!-- x-release-please-version -->
20
+
The [`LdtkEntity` derive macro](game-logic-integration.html#ldtkentity-and-ldtkintcell-registration) allows you to define entities as ["worldly"](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/app/trait.LdtkEntity.html#worldly). <!-- x-release-please-version -->
21
21
The intention of this feature is to support entities that are allowed to persist and traverse between levels, like a player in a GridVania layout.
22
22
23
23
One consequence of an entity being worldly is a change in its placement in the above hierarchy.
@@ -32,8 +32,8 @@ For example, if the worldly player entity traverses far enough away that their o
32
32
LDtk allows you to associate metadata with particular tiles in a tileset.
33
33
`bevy_ecs_ldtk` responds to this by adding additional components to tiles that have metadata *in addition to* those described in the [hierarchy](#hierarchy):
Naturally, this can only occur in Tile/AutoTile layers (or IntGrid layers with AutoTile functionality), since the metadata is defined on tilesets.
39
39
@@ -43,7 +43,7 @@ LDtk allows you to supply a background color and a background image for individu
43
43
The background color is spawned as a normal bevy [`Sprite`](https://docs.rs/bevy/latest/bevy/prelude/struct.Sprite.html), as a child of the level entity.
44
44
The background image, if it exists, is also spawned as a `Sprite`.
45
45
46
-
These background sprites can be disabled (not spawned) using the settings resource [`LdtkSettings`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LdtkSettings.html): <!-- x-release-please-version -->
46
+
These background sprites can be disabled (not spawned) using the settings resource [`LdtkSettings`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LdtkSettings.html): <!-- x-release-please-version -->
47
47
```rust,no_run
48
48
use bevy::prelude::*;
49
49
use bevy_ecs_ldtk::prelude::*;
@@ -65,7 +65,7 @@ In other words, a single layer can have more than one tile in the same location.
65
65
66
66
`bevy_ecs_tilemap` tilemaps only allow one tile per position.
67
67
So, `bevy_ecs_ldtk` supports layers with colliding tiles by spawning multiple tilemaps.
68
-
Each of them will have the same [`LayerMetadata`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
68
+
Each of them will have the same [`LayerMetadata`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
69
69
This means that users cannot assume that there will be only one `LayerMetadata` entity per layer.
Copy file name to clipboardExpand all lines: book/src/explanation/level-selection.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# Level Selection
2
-
Once you have spawned an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LdtkWorldBundle.html) with a handle pointing to your LDtk project file, the levels you have selected will spawn as children of the world bundle. <!-- x-release-please-version -->
2
+
Once you have spawned an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LdtkWorldBundle.html) with a handle pointing to your LDtk project file, the levels you have selected will spawn as children of the world bundle. <!-- x-release-please-version -->
3
3
You have a couple options for selecting levels, which will be discussed in this chapter.
4
4
5
5
## `LevelSelection` resource
6
-
The highest-level option for selecting a level to spawn is using the [`LevelSelection`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/enum.LevelSelection.html) resource. <!-- x-release-please-version -->
6
+
The highest-level option for selecting a level to spawn is using the [`LevelSelection`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/enum.LevelSelection.html) resource. <!-- x-release-please-version -->
7
7
This resource allows you to specify a particular level either by its indices in the project/world, its identifier, its iid, or its uid.
8
8
Once this resource is added or changed, levels will be spawned/despawned in order to match your selection.
9
9
10
10
One additional feature worth pointing out is loading level neighbors.
11
-
You can enable this with the settings resource [`LdtkSettings`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LdtkSettings.html): <!-- x-release-please-version -->
11
+
You can enable this with the settings resource [`LdtkSettings`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LdtkSettings.html): <!-- x-release-please-version -->
12
12
13
13
```rust,no_run
14
14
use bevy::prelude::*;
@@ -33,7 +33,7 @@ This can be especially useful for GridVania/Free-style worlds where it's importa
33
33
Note: this *only* works if you are using the `LevelSelection` resource.
34
34
35
35
## `LevelSet` component
36
-
One component in the `LdtkWorldBundle` is [`LevelSet`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.LevelSet.html). <!-- x-release-please-version -->
36
+
One component in the `LdtkWorldBundle` is [`LevelSet`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.LevelSet.html). <!-- x-release-please-version -->
37
37
This component can be used for lower-level level selection.
38
38
Instead of selecting one level globally with a `LevelSelection` resource, you can select a specific set of levels by their iids.
Copy file name to clipboardExpand all lines: book/src/how-to-guides/respawn-levels-and-worlds.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# Respawn Levels and Worlds
2
-
Internally, `bevy_ecs_ldtk` uses a [`Respawn`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.Respawn.html) component on worlds and levels to assist in the spawning process. <!-- x-release-please-version -->
2
+
Internally, `bevy_ecs_ldtk` uses a [`Respawn`](https://docs.rs/bevy_ecs_ldtk/0.11.0/bevy_ecs_ldtk/prelude/struct.Respawn.html) component on worlds and levels to assist in the spawning process. <!-- x-release-please-version -->
3
3
This can be leveraged by users to implement a simple level restart feature, or an even more heavy-handed world restart feature.
4
4
5
5
This code is from the `collectathon` cargo example.
0 commit comments