Trouv / bevy_ecs_ldtk

ECS-friendly ldtk plugin for bevy, leveraging bevy_ecs_tilemap
Other
664 stars 75 forks source link

Migrated to bevy 0.9 #138

Closed John-Toohey closed 1 year ago

John-Toohey commented 1 year ago

Does not apply to the platformer example (rapier2d) because we are waiting on https://github.com/dimforge/bevy_rapier/pull/272. When that PR is merged I will update this.

Trouv commented 1 year ago

When that PR is merged I will update this.

Feel free to depend on that PR in main. I'm also down to update that example in a separate PR if it's a lot of changes.

johanhelsing commented 1 year ago

I think

app.add_plugin(bevy_ecs_tilemap::TilemapPlugin)

should probably be removed from LdtkPlugin::build. If more than one plugins does this, the user will get panics like:

thread 'main' panicked at 'Error adding plugin bevy_ecs_tilemap::TilemapPlugin: : plugin was already added in application', C:\Users\Johan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_app-0.9.0\src\app.rs:841:63
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Alternatively, put it behind a app.is_plugin_added check.

johanhelsing commented 1 year ago

Not sure if it's this PR, or an existing bevy_ecs_ldtk issue, but I have problems with the background and tiles not lining up:

image

The white box is the background for the level with the sunnyland grass textures, so either the positions of the background or the tiles is off.

image

Trouv commented 1 year ago

I have problems with the background and tiles not lining up:

This should be fixed by #136, this PR hasn't pulled from main since that was merged

John-Toohey commented 1 year ago

I think

app.add_plugin(bevy_ecs_tilemap::TilemapPlugin)

should probably be removed from LdtkPlugin::build. If more than one plugins does this, the user will get panics like:

thread 'main' panicked at 'Error adding plugin bevy_ecs_tilemap::TilemapPlugin: : plugin was already added in application', C:\Users\Johan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_app-0.9.0\src\app.rs:841:63
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Alternatively, put it behind a app.is_plugin_added check.

Fixed in 90092d8

John-Toohey commented 1 year ago

Rebased based of upstream

Trouv commented 1 year ago

Pushing a formatting change...