jcornaz / heron

[DISCONTINUED] An ergonomic physics API for bevy games
MIT License
292 stars 44 forks source link

Update to Bevy 0.5 #79

Closed ValorZard closed 3 years ago

ValorZard commented 3 years ago

Pretty self explanatory. I think it would be nice if you could also update to the latest version of rapier while you're at it, if its possible.

jcornaz commented 3 years ago

Yes, ofc.

Migration to bevy 0.5 is already in progress (#78). But we'll have to wait for the upstream library bevy_prototype_lyon to be published first.

Rapier is already up-to-date in the main branch (not released).

yaymalaga commented 3 years ago

The new bevy_prototype_lyon update is now released!

yaymalaga commented 3 years ago

Just out of curiosity, is there any plan to support Bevy's new States V2?

As the release notes show, we can now add systems to run on the lifecycles of custom states:

#[derive(Debug, Clone, Eq, PartialEq, Hash)]
enum AppState {
    Menu,
    InGame,
}

fn main() {
    App::build()
        .add_state(AppState::Menu)
        .add_system_set(SystemSet::on_enter(AppState::Menu).with_system(setup_menu.system()))
        .add_system_set(SystemSet::on_update(AppState::Menu).with_system(menu_logic.system()))
        .add_system_set(
            SystemSet::on_update(AppState::InGame)
                .with_system(game_logic.system())
        )
        .run();
}

Ideally, we should be able to run the physics systems just on AppState::InGame, instead of using .add_physics_system():

fn main() {
    App::build()
        .add_system_set(
            SystemSet::on_update(AppState::InGame)
                .with_system(game_logic.system())
                .with_physics_system(game_physics_logic.system())
        )
        .run();
}
jcornaz commented 3 years ago

This wasn't planned until now. But that's sound like a good idea, so you can create a separate issue for this ;-)