Hello world stuff

This commit is contained in:
Greg Shuflin 2023-03-18 12:04:25 -07:00
parent b297d63e31
commit 6ef71e4b2a

View File

@ -1,11 +1,34 @@
use bevy::prelude::*; 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() { fn gamarjoba() {
println!("Gamarjoba, munde!"); println!("Gamarjoba, munde!");
} }
fn main() { fn main() {
App::new() App::new()
.add_startup_system(add_people)
.add_system(greetings)
.add_system(gamarjoba) .add_system(gamarjoba)
.run(); .run();
} }