bevy-playground/src/statue.rs

34 lines
884 B
Rust
Raw Normal View History

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<AssetLoader>) {
commands.spawn((
Statue,
SpriteSheetBundle {
2023-12-24 21:30:18 -06:00
texture_atlas: assets.images.statue.clone(),
2024-05-17 09:11:33 -05:00
sprite: TextureAtlas::new(0),
transform: Transform::from_translation(Vec3::new(50., 50., 0.)),
..Default::default()
},
));
commands.spawn((
Statue,
SpriteSheetBundle {
2023-12-24 21:30:18 -06:00
texture_atlas: assets.images.statue.clone(),
2024-05-17 09:11:33 -05:00
sprite: TextureAtlas::new(0),
transform: Transform::from_translation(Vec3::new(50., 100., 0.)),
..Default::default()
},
));
}