bevy/examples/simple.rs
2019-12-01 01:16:15 -08:00

18 lines
563 B
Rust

use bevy::{Application, Transform};
use legion::prelude::*;
fn main() {
Application::run();
// Create a world to store our entities
let universe = Universe::new();
let mut world = universe.create_world();
world.insert((), vec![(Transform::new(),)]);
// Create a query which finds all `Position` and `Velocity` components
let mut query = Read::<Transform>::query();
// // Iterate through all entities that match the query in the world
for _ in query.iter(&mut world) {
// println!("{} hi", trans.global);
}
}