Add basic systems

This commit is contained in:
Daniel Lynn 2021-07-12 22:43:15 -05:00
parent c8384883ad
commit e863f5af88
Signed by: daniel
GPG Key ID: 28496A140E180A9D

15
src/systems/mod.rs Normal file
View File

@ -0,0 +1,15 @@
use crate::components::{Name, Player};
use bevy::prelude::*;
pub fn add_player(mut commands: Commands) {
commands
.spawn()
.insert(Player)
.insert(Name("Player 1".to_string()));
}
pub fn greet_player(query: Query<&Name, With<Player>>) {
for name in query.iter() {
println!("Hello, {}!", name.0);
}
}