mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 06:00:20 +00:00
18 lines
563 B
Rust
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);
|
|
}
|
|
}
|