use crate::{assets::AssetLoader, movement::YSortable}; use bevy::prelude::*; #[derive(Component, Debug)] pub struct Statue; pub fn startup(mut commands: Commands, assets: Res, asset_server: Res) { let texture = asset_server.load("img/Props.png"); commands.spawn(( Statue, YSortable, SpriteSheetBundle { texture: texture.clone(), atlas: TextureAtlas { layout: assets.images.statue.clone(), index: 0, }, transform: Transform::from_translation(Vec3::new(50., 50., 0.)), ..Default::default() }, )); commands.spawn(( Statue, YSortable, SpriteSheetBundle { texture: texture.clone(), atlas: TextureAtlas { layout: assets.images.statue.clone(), index: 0, }, transform: Transform::from_translation(Vec3::new(50., 100., 0.)), ..Default::default() }, )); } pub fn exit(mut commands: Commands, q: Query>) { for id in q.iter() { commands.entity(id).despawn_recursive(); } }