pub fn character_gravity_multiplier(
    game: Res<Game>,
    game_config: Res<GameConfig>,
    mut rigidbodies: ResMut<RigidBodySet>,
    mut query: Query<(&Character, &RigidBodyHandleComponent)>,
) {
    if game.paused {
        return;
    }

    for (character, rbhandle) in query.iter_mut() {
        if let Some(rigidbody) = rigidbodies.get_mut(rbhandle.handle()) {
            if !character.grounded {
                rigidbody.apply_force(game_config.character_gravity, true);
            }
        }
    }
}
/// Characters fall faster for better mechanics
/// without having to affect the gravity effects of everything else
Characters fall faster for better mechanics
without having to affect the gravity effects of everything else
Characters fall faster for better mechanics without having to affect the gravity effects of everything else
pub fn character_gravity_multiplier(
    game: Res<Game>,
    game_config: Res<GameConfig>,
    mut rigidbodies: ResMut<RigidBodySet>,
    mut query: Query<(&Character, &RigidBodyHandleComponent)>,
) {
    if game.paused {
        return;
    }
    for (character, rbhandle) in query.iter_mut() {
        if let Some(rigidbody) = rigidbodies.get_mut(rbhandle.handle()) {
            if !character.grounded {
                rigidbody.apply_force(game_config.character_gravity, true);
            }
        }
    }
}
pub fn character_gravity_multiplier ( game : Res < Game > , game_config : Res < GameConfig > , mut rigidbodies : ResMut < RigidBodySet > , mut query : Query < ( & Character , & RigidBodyHandleComponent ) > , ) { if game . paused { return ; } for ( character , rbhandle ) in query . iter_mut ( ) { if let Some ( rigidbody ) = rigidbodies . get_mut ( rbhandle . handle ( ) ) { if ! character . grounded { rigidbody . apply_force ( game_config . character_gravity , true ) ; } } } }
Characters fall faster for better mechanics
without having to affect the gravity effects of everything else
Characters fall faster for better mechanics without having to affect the gravity effects of everything else
game
Res<Game>
game_config
Res<GameConfig>
rigidbodies
ResMut<RigidBodySet>
query
Query<(&Character, &RigidBodyHandleComponent)>
game
Res<Game>
game_config
Res<GameConfig>
rigidbodies
ResMut<RigidBodySet>
query
Query<(&Character, &RigidBodyHandleComponent)>