I want to write a toy-level simulation in Bevy, but from scratch. So I do not use the DefaultPlugins. This is my code now:
use bevy::prelude::*;
fn main() {
App::new()
.add_systems(Startup, startup)
.run();
}
#[derive(Component)]
struct HP(i32);
fn acid_rain(
mut q:Query<&mut HP>
) {
q.for_each_mut(|mut hp| {
hp.0 -= 1;
})
}
fn startup(
mut commands:Commands
) {
commands.spawn(HP(100));
}
The problem was - it terminated immediately. So is there anything am I missing?