diff --git a/src/main.rs b/src/main.rs index 7ac5f2f..bc3654d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,34 @@ use bevy::prelude::*; +#[derive(Component)] +struct Person; + + +#[derive(Component)] +struct Name(String); + +fn add_people(mut commands: Commands) { + + commands.spawn((Person, Name("Skero Tlamenai".into()))); + commands.spawn((Person, Name("Wagoyesa Luutunen".into()))); + commands.spawn((Person, Name("Mak'lazi Heyorem".into()))); +} + +fn greetings(query: Query<&Name, With>) { + for name in &query { + println!("Gamarjoba, {}", name.0) + } + +} + fn gamarjoba() { println!("Gamarjoba, munde!"); } fn main() { App::new() + .add_startup_system(add_people) + .add_system(greetings) .add_system(gamarjoba) .run(); }