34 lines
898 B
Rust
34 lines
898 B
Rust
|
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 {
|
||
|
texture_atlas: assets.sprites.statue.clone(),
|
||
|
sprite: TextureAtlasSprite::new(0),
|
||
|
transform: Transform::from_translation(Vec3::new(50., 50., 0.)),
|
||
|
..Default::default()
|
||
|
},
|
||
|
));
|
||
|
commands.spawn((
|
||
|
Statue,
|
||
|
SpriteSheetBundle {
|
||
|
texture_atlas: assets.sprites.statue.clone(),
|
||
|
sprite: TextureAtlasSprite::new(0),
|
||
|
transform: Transform::from_translation(Vec3::new(50., 100., 0.)),
|
||
|
..Default::default()
|
||
|
},
|
||
|
));
|
||
|
}
|