Проектная работа - WIP

bevy learning
This commit is contained in:
4 changed files with 20 additions and 15 deletions
+11
View File
@@ -1,13 +1,17 @@
/// Эксперименты в ходе прохождения туториала:
/// https://github.com/fogarecious/bevy_tutorial
use bevy::{prelude::*, winit::WinitSettings};
use tracing::Level;
fn main() {
App::new()
// .add_plugins(MinimalPlugins)
.add_plugins(
DefaultPlugins
.build()
.set(bevy::log::LogPlugin {
level: Level::INFO,
filter: "bevy_app=trace".to_string(),
fmt_layer: |_| snake_game::define_log_layer(),
..Default::default()
})
@@ -18,6 +22,7 @@ fn main() {
.insert_resource(WinitSettings::desktop_app())
.insert_resource(ClearColor(Color::srgb(0.3, 0.6, 0.8)))
.add_systems(Startup, setup)
.add_systems(PostStartup, print_all_entities)
.run();
}
@@ -29,3 +34,9 @@ fn setup(mut commands: Commands) {
Sprite::from_color(Color::srgb(1., 1., 1.), Vec2::new(100., 50.)),
);
}
fn print_all_entities(mut commands: Commands, query: Query<Entity>) {
for entity in query {
commands.entity(entity).log_components();
}
}