Skip to content

Commit

Permalink
chore(main): release 0.10.0 (#312)
Browse files Browse the repository at this point in the history
🤖 I have created a release *beep* *boop*
---


##
[0.10.0](v0.9.0...v0.10.0)
(2024-07-20)


### ⚠ BREAKING CHANGES

* upgrade to bevy and bevy_ecs_ldtk 0.14
([#325](#325))
* upgrade to bevy 0.13
([#302](#302))

### Features

* add #[default] attribute to LdtkEntity and LdtkIntCell derive macros
([#306](#306))
([416a46e](416a46e))
* upgrade to bevy 0.13
([#302](#302))
([2ee602f](2ee602f)),
closes [#301](#301)
* upgrade to bevy and bevy_ecs_ldtk 0.14
([#325](#325))
([d888535](d888535))


### Documentation Changes

* remove unused AssetServer param in *Game logic integration* chapter
([#318](#318))
([617b108](617b108))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
  • Loading branch information
Trouv authored Jul 20, 2024
1 parent 1c086b6 commit c72b5c8
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 39 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## [0.10.0](https://github.com/Trouv/bevy_ecs_ldtk/compare/v0.9.0...v0.10.0) (2024-07-20)


### ⚠ BREAKING CHANGES

* upgrade to bevy and bevy_ecs_ldtk 0.14 ([#325](https://github.com/Trouv/bevy_ecs_ldtk/issues/325))
* upgrade to bevy 0.13 ([#302](https://github.com/Trouv/bevy_ecs_ldtk/issues/302))

### Features

* add #[default] attribute to LdtkEntity and LdtkIntCell derive macros ([#306](https://github.com/Trouv/bevy_ecs_ldtk/issues/306)) ([416a46e](https://github.com/Trouv/bevy_ecs_ldtk/commit/416a46ea832ad85fe852abc3fd3a46e05a1550b7))
* upgrade to bevy 0.13 ([#302](https://github.com/Trouv/bevy_ecs_ldtk/issues/302)) ([2ee602f](https://github.com/Trouv/bevy_ecs_ldtk/commit/2ee602ff46969d58f4a22db34c2ea4e42c6cac75)), closes [#301](https://github.com/Trouv/bevy_ecs_ldtk/issues/301)
* upgrade to bevy and bevy_ecs_ldtk 0.14 ([#325](https://github.com/Trouv/bevy_ecs_ldtk/issues/325)) ([d888535](https://github.com/Trouv/bevy_ecs_ldtk/commit/d888535e4c57147f60dd0de6878ada0c8fe8611e))


### Documentation Changes

* remove unused AssetServer param in *Game logic integration* chapter ([#318](https://github.com/Trouv/bevy_ecs_ldtk/issues/318)) ([617b108](https://github.com/Trouv/bevy_ecs_ldtk/commit/617b108dfc22799047cdb4d2c84c3cdfba7e985a))

## [0.9.0](https://github.com/Trouv/bevy_ecs_ldtk/compare/v0.8.0...v0.9.0) (2024-02-11)


Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_ecs_ldtk"
description = "An ECS-friendly ldtk plugin for bevy."
version = "0.9.0"
version = "0.10.0"
edition = "2021"
authors = ["Trevor Lovell <[email protected]>"]
repository = "https://github.com/Trouv/bevy_ecs_ldtk"
Expand All @@ -14,7 +14,7 @@ exclude = ["assets/*", "repo/*", "scripts/*"]
members = ["macros"]

[dependencies]
bevy_ecs_ldtk_macros = { version = "0.9.0", optional = true, path = "macros" }
bevy_ecs_ldtk_macros = { version = "0.10.0", optional = true, path = "macros" }
bevy_ecs_tilemap = { version = "0.14.0", default-features = false}
bevy = { version = "0.14", default-features = false, features = ["bevy_sprite"] }
derive-getters = "0.3.0"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ For less common use cases, strategies that leverage this plugin's ECS constructs

## Documentation
Documentation for this plugin is available in two main places.
- API reference on [docs.rs](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/) <!-- x-release-please-version -->
- Tutorials, Explanation, and Guides in the [`bevy_ecs_ldtk` book](https://trouv.github.io/bevy_ecs_ldtk/v0.9.0/index.html) <!-- x-release-please-version -->
- API reference on [docs.rs](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/) <!-- x-release-please-version -->
- 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 -->

In the book, the following chapters are good jumping-off points for beginners:
- [*Tile-based Game* tutorial](https://trouv.github.io/bevy_ecs_ldtk/v0.9.0/tutorials/tile-based-game/index.html) <!-- x-release-please-version -->
- [*Level Selection* explanation](https://trouv.github.io/bevy_ecs_ldtk/v0.9.0/explanation/level-selection.html) <!-- x-release-please-version -->
- [*Game Logic Integration* explanation](https://trouv.github.io/bevy_ecs_ldtk/v0.9.0/explanation/game-logic-integration.html) <!-- x-release-please-version -->
- [*Tile-based Game* tutorial](https://trouv.github.io/bevy_ecs_ldtk/v0.10.0/tutorials/tile-based-game/index.html) <!-- x-release-please-version -->
- [*Level Selection* explanation](https://trouv.github.io/bevy_ecs_ldtk/v0.10.0/explanation/level-selection.html) <!-- x-release-please-version -->
- [*Game Logic Integration* explanation](https://trouv.github.io/bevy_ecs_ldtk/v0.10.0/explanation/game-logic-integration.html) <!-- x-release-please-version -->

Cargo examples are also available in this repository:
```sh
Expand Down
2 changes: 1 addition & 1 deletion book/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Some resources for learning Bevy include those listed on the [Bevy website](http
LDtk also provides documentation on [its website](https://ldtk.io/docs/).

`bevy_ecs_ldtk`'s [source code](https://github.com/Trouv/bevy_ecs_ldtk) is available on github.
This repository also contains [cargo examples](https://github.com/Trouv/bevy_ecs_ldtk/tree/v0.9.0/examples), which can be run after cloning the repository using `$ cargo run --example example-name`. <!-- x-release-please-version -->
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 -->
These examples may be difficult to follow on their own, and many of their strategies are described in this book.
When viewing these examples, be careful to checkout the correct git tag for the version of the plugin you are using.
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.
Expand Down
24 changes: 12 additions & 12 deletions book/src/explanation/anatomy-of-the-world.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Anatomy of the World
Once an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.9.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 -->
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 -->
The result is a deeply nested hierarchy of entities which can be difficult to navigate, but predictable.
It can be useful to write code that makes assumptions about the relationships between `bevy_ecs_ldtk` entities.
To assist with this, this chapter will explain the anatomy of a `bevy_ecs_ldtk` world.
Expand All @@ -8,16 +8,16 @@ To assist with this, this chapter will explain the anatomy of a `bevy_ecs_ldtk`
The basic hierarchy of spawned entities and their identifying components/bundles are as follows.
This does exclude some special cases which are explained in more detail below.
Each bullet indent indicates a parent/child relationship.
- The world entity, with an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.LdtkWorldBundle.html) bundle. <!-- x-release-please-version -->
- The level entities, with a [`LevelIid`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.LevelIid.html) component. <!-- x-release-please-version -->
- For Entity layers - a layer entity with just a [`LayerMetadata`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
- LDtk Entity entities, with an [`EntityInstance`](https://docs.rs/bevy_ecs_ldtk/0.9.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 -->
- 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.9.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
- For IntGrid layers - tile entities with an [`IntGridCell`](https://docs.rs/bevy_ecs_ldtk/0.9.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 -->
- 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 -->
- 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 -->
- 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 -->
- 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 -->
- 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 -->
- 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 -->
- 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.

## Worldly Entities
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.9.0/bevy_ecs_ldtk/app/trait.LdtkEntity.html#worldly). <!-- x-release-please-version -->
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 -->
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.

One consequence of an entity being worldly is a change in its placement in the above hierarchy.
Expand All @@ -32,8 +32,8 @@ For example, if the worldly player entity traverses far enough away that their o
LDtk allows you to associate metadata with particular tiles in a tileset.
`bevy_ecs_ldtk` responds to this by adding additional components to tiles that have metadata *in addition to* those described in the [hierarchy](#hierarchy):

- [`TileMetadata`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.TileMetadata.html) <!-- x-release-please-version -->
- [`TileEnumTags`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.TileEnumTags.html) <!-- x-release-please-version -->
- [`TileMetadata`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.TileMetadata.html) <!-- x-release-please-version -->
- [`TileEnumTags`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/prelude/struct.TileEnumTags.html) <!-- x-release-please-version -->

Naturally, this can only occur in Tile/AutoTile layers (or IntGrid layers with AutoTile functionality), since the metadata is defined on tilesets.

Expand All @@ -43,7 +43,7 @@ LDtk allows you to supply a background color and a background image for individu
The background color is spawned as a normal bevy [`SpriteBundle`](https://docs.rs/bevy/latest/bevy/prelude/struct.SpriteBundle.html), as a child of the level entity.
The background image, if it exists, is also spawned as a `SpriteBundle`.

These background sprites can be disabled (not spawned) using the settings resource [`LdtkSettings`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.LdtkSettings.html): <!-- x-release-please-version -->
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 -->
```rust,no_run
use bevy::prelude::*;
use bevy_ecs_ldtk::prelude::*;
Expand All @@ -65,7 +65,7 @@ In other words, a single layer can have more than one tile in the same location.

`bevy_ecs_tilemap` tilemaps only allow one tile per position.
So, `bevy_ecs_ldtk` supports layers with colliding tiles by spawning multiple tilemaps.
Each of them will have the same [`LayerMetadata`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.LayerMetadata.html) component. <!-- x-release-please-version -->
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 -->
This means that users cannot assume that there will be only one `LayerMetadata` entity per layer.


Expand Down
4 changes: 2 additions & 2 deletions book/src/explanation/game-logic-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Without any intervention, the bundle's fields are constructed using the bundle's
However, various attributes are available to override this behavior, like `#[sprite_bundle]` in the above example.
This attribute gives the entity a sprite using the tileset in its LDtk editor visual.
For documentation about all the available attributes, check out the API reference for these traits:
- [`LdtkEntity`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/app/trait.LdtkEntity.html) <!-- x-release-please-version -->
- [`LdtkIntCell`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/app/trait.LdtkIntCell.html) <!-- x-release-please-version -->
- [`LdtkEntity`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/app/trait.LdtkEntity.html) <!-- x-release-please-version -->
- [`LdtkIntCell`](https://docs.rs/bevy_ecs_ldtk/0.10.0/bevy_ecs_ldtk/app/trait.LdtkIntCell.html) <!-- x-release-please-version -->

This approach is suitable for many common, simple use cases.
There's also room for more granular, component-level customization within some of the attributes, like `#[with(...)]` or `#[from_entity_instance]`.
Expand Down
8 changes: 4 additions & 4 deletions book/src/explanation/level-selection.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Level Selection
Once you have spawned an [`LdtkWorldBundle`](https://docs.rs/bevy_ecs_ldtk/0.9.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 -->
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 -->
You have a couple options for selecting levels, which will be discussed in this chapter.

## `LevelSelection` resource
The highest-level option for selecting a level to spawn is using the [`LevelSelection`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/enum.LevelSelection.html) resource. <!-- x-release-please-version -->
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 -->
This resource allows you to specify a particular level either by its indices in the project/world, its identifier, its iid, or its uid.
Once this resource is added or changed, levels will be spawned/despawned in order to match your selection.

One additional feature worth pointing out is loading level neighbors.
You can enable this with the settings resource [`LdtkSettings`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.LdtkSettings.html): <!-- x-release-please-version -->
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 -->

```rust,no_run
use bevy::prelude::*;
Expand All @@ -33,7 +33,7 @@ This can be especially useful for GridVania/Free-style worlds where it's importa
Note: this *only* works if you are using the `LevelSelection` resource.

## `LevelSet` component
One component in the `LdtkWorldBundle` is [`LevelSet`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.LevelSet.html). <!-- x-release-please-version -->
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 -->
This component can be used for lower-level level selection.
Instead of selecting one level globally with a `LevelSelection` resource, you can select a specific set of levels by their iids.
From the `level_set` cargo example:
Expand Down
2 changes: 1 addition & 1 deletion book/src/how-to-guides/respawn-levels-and-worlds.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Respawn Levels and Worlds
Internally, `bevy_ecs_ldtk` uses a [`Respawn`](https://docs.rs/bevy_ecs_ldtk/0.9.0/bevy_ecs_ldtk/prelude/struct.Respawn.html) component on worlds and levels to assist in the spawning process. <!-- x-release-please-version -->
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 -->
This can be leveraged by users to implement a simple level restart feature, or an even more heavy-handed world restart feature.

This code is from the `collectathon` cargo example.
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_ecs_ldtk_macros"
description = "Derive macros for bevy_ecs_ldtk."
version = "0.9.0"
version = "0.10.0"
edition = "2021"
authors = ["Trevor Lovell <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/app/ldtk_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ use std::{collections::HashMap, marker::PhantomData};
/// [Worldly] entities don't despawn when their birth level despawns, and they don't respawn when
/// their birth level respawns.
/// For a more detailed explanation, please see the
/// [*Worldly Entities*](https://trouv.github.io/bevy_ecs_ldtk/v0.9.0/explanation/anatomy-of-the-world.html#worldly-entities) <!-- x-release-please-version -->
/// [*Worldly Entities*](https://trouv.github.io/bevy_ecs_ldtk/v0.10.0/explanation/anatomy-of-the-world.html#worldly-entities) <!-- x-release-please-version -->
/// section of the `bevy_ecs_ldtk` book.
/// ```
/// # use bevy::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion src/components/level_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::LevelIid;
/// [`Component`] that determines the desired levels to be spawned in an [`LdtkWorldBundle`].
///
/// For more explanation and comparison of options for selecting levels to spawn, see the
/// [*Level Selection*](https://trouv.github.io/bevy_ecs_ldtk/v0.9.0/explanation/level-selection.html) <!-- x-release-please-version -->
/// [*Level Selection*](https://trouv.github.io/bevy_ecs_ldtk/v0.10.0/explanation/level-selection.html) <!-- x-release-please-version -->
/// chapter of the `bevy_ecs_ldtk` book.
///
/// [`Component`]: https://docs.rs/bevy/latest/bevy/ecs/prelude/trait.Component.html
Expand Down
Loading

0 comments on commit c72b5c8

Please sign in to comment.