Hello world stuff
This commit is contained in:
parent
b297d63e31
commit
6ef71e4b2a
23
src/main.rs
23
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<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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user