diff --git a/src/main.rs b/src/main.rs index 6ecf13c..f47d66d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,7 @@ use bevy::prelude::*; fn main() { - App::new() - .add_plugins(DefaultPlugins) - .add_systems(Startup, add_people) - .add_systems(Update, (hello_world, greet_people).chain()) - .run(); + App::new().add_plugins((DefaultPlugins, HelloPlugin)).run(); } fn hello_world() { @@ -29,3 +25,12 @@ fn greet_people(query: Query<&Name, With>) { println!("hello {}!", name.0); } } + +pub struct HelloPlugin; + +impl Plugin for HelloPlugin { + fn build(&self, app: &mut App) { + app.add_systems(Startup, add_people) + .add_systems(Update, (hello_world, greet_people).chain()); + } +}