use bevy::prelude::*; use crate::assets::AssetLoader; #[derive(Component, Debug)] pub struct Statue; impl Plugin for Statue { fn build(&self, app: &mut App) { app.add_systems(PostStartup, spawn_statue); } } fn spawn_statue(mut commands: Commands, assets: Res, asset_server: Res) { let texture = asset_server.load("img/Props.png"); commands.spawn(( Statue, 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, SpriteSheetBundle { texture: texture.clone(), atlas: TextureAtlas { layout: assets.images.statue.clone(), index: 0, }, transform: Transform::from_translation(Vec3::new(50., 100., 0.)), ..Default::default() }, )); }