Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing levels on top of each other #286

Open
mainrs opened this issue Dec 29, 2023 · 1 comment
Open

Drawing levels on top of each other #286

mainrs opened this issue Dec 29, 2023 · 1 comment

Comments

@mainrs
Copy link

mainrs commented Dec 29, 2023

I am creating a tower where some floors have holes in them. I want the floor under the current one to be visible.

Can this be done easily with this plugin? It looks like as soon as I switch the LevelSelection, everything is removed and the new entities are created.

@Trouv
Copy link
Owner

Trouv commented Dec 31, 2023

You can spawn multiple levels at once, either automatically by setting load_level_neighbors to true in LdtkSettings:

use bevy::prelude::*;
use bevy_ecs_ldtk::prelude::*;

fn main() {
    App::new()
        // other App builders
        .insert_resource(LevelSelection::index(0))
        .insert_resource(LdtkSettings {
            level_spawn_behavior: LevelSpawnBehavior::UseWorldTranslation {
                load_level_neighbors: true
            },
            ..default()
        })
        .run();

Or by not using LevelSelection at all and selecting multiple levels by their iid in the LdtkWorldBundle's LevelSet component. In either case you should probably be using the LevelSpawnBehavior::UseWorldTranslation option in the above example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants