diff --git a/src/main.rs b/src/main.rs index 1d183d1..c49d80e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,29 @@ -use bevy::{prelude::*}; +use bevy::prelude::*; fn main() { println!("Hello, world!"); App::new() - .add_plugins(DefaultPlugins) - .run(); + .add_plugins(DefaultPlugins) + .add_systems(Startup, setup) + .add_systems(Update, moveng) + .run(); +} + +#[derive(Component)] +struct Move; + +fn setup(mut commands: Commands, assets: Res) { + commands.spawn(Camera2d); + commands.spawn(( + Sprite::from_image(assets.load("02-00.png")), + Transform::from_scale(Vec3::splat(0.1)), + Move, + )); +} + +fn moveng(mut m_srite: Query<(&mut Transform, &Move)>) { + for (mut tr, _) in m_srite { + tr.translation.x += 0.1; + } }