This commit is contained in:
Greg Shuflin 2025-01-08 02:00:28 -08:00
parent d679712dd8
commit 932866a943
3 changed files with 805 additions and 400 deletions

1181
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"
[dependencies]
bevy = { version = "0.14.2", features = ["dynamic_linking"] }
bevy = { version = "0.15.1", features = ["dynamic_linking"] }
[profile.dev]
opt-level = 1

View File

@ -1,12 +1,32 @@
use bevy::prelude::*;
#[derive(Component)]
struct Person;
#[derive(Component)]
struct Name(String);
fn add_people(mut commands: Commands) {
commands.spawn((Person, Name("Lars Larson".to_string())));
commands.spawn((Person, Name("Cedric Fagbottom".to_string())));
commands.spawn((Person, Name("Orlando Tampa".to_string())));
}
fn gamarjoba() {
println!("Gamarjoba, munde!");
}
fn greet_people(query: Query<&Name, With<Person>>) {
for name in &query {
println!("'sup {}", name.0);
}
}
fn main() {
App::new()
.add_systems(Update, gamarjoba)
.add_systems(Startup, add_people)
.add_systems(Update, (gamarjoba, greet_people))
.run();
}