Hello world stuff

This commit is contained in:
Greg Shuflin 2023-03-18 12:04:25 -07:00
parent b297d63e31
commit 6ef71e4b2a
1 changed files with 23 additions and 0 deletions

View File

@ -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<Person>>) {
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();
}