Compare commits
No commits in common. "6705870f8109705119d0a2a0beda7cdd55259cc9" and "11dc9771cc97de3ee731c15d46e0584a25bf6581" have entirely different histories.
6705870f81
...
11dc9771cc
@ -1,2 +0,0 @@
|
||||
pub struct Name(pub String);
|
||||
pub struct Player;
|
@ -1,12 +1,5 @@
|
||||
mod components;
|
||||
mod systems;
|
||||
|
||||
use bevy::prelude::*;
|
||||
use systems::*;
|
||||
|
||||
fn main() {
|
||||
App::build()
|
||||
.add_startup_system(add_player.system())
|
||||
.add_system(greet_player.system())
|
||||
.run();
|
||||
App::build().run();
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user