From 4d48236931a3eacacd7c02ae6fd3917cc9da46f3 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 21 Apr 2024 19:16:03 +0200 Subject: [PATCH] completed first steps --- src/main.rs | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8df11f9..669d0fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,16 +2,10 @@ use bevy::prelude::*; fn main() { App::new() - .add_plugins(DefaultPlugins) - .add_systems(Startup, add_people) - .add_systems(Update, (hello_world, (update_people, greet_people).chain())) + .add_plugins((DefaultPlugins, HelloPlugin)) .run(); } -fn hello_world() { - println!("hi!"); -} - #[derive(Component)] struct Person; @@ -24,9 +18,18 @@ fn add_people(mut commands: Commands) { commands.spawn((Person, Name("Marie Skłodowska".to_string()))); } -fn greet_people(query: Query<&Name, With>) { - for name in &query { - println!("hello {}!", name.0); +#[derive(Resource)] +struct GreetTimer(Timer); + +fn greet_people( + time: Res