diff --git a/src/player.rs b/src/player.rs index 444851f..3298250 100644 --- a/src/player.rs +++ b/src/player.rs @@ -19,6 +19,9 @@ const PLAYER_SPEED: f32 = 500.; #[derive(Component, Debug)] pub struct Player; +#[derive(Component, Debug)] +pub struct PlayerSprite; + #[derive(Component, Debug)] pub struct Crosshair; @@ -58,6 +61,7 @@ pub fn startup( )) .with_children(|player| { player.spawn(( + PlayerSprite, Name::new("PlayerSprite"), SpriteBundle { texture: assets.load("img/Player.png"), @@ -107,10 +111,21 @@ pub fn control( input: Res, mut crosshair: Query<&mut Transform, With>, mut player: Query<&mut Heading, With>, + mut sprite: Query<(&mut Sprite, &mut TextureAtlas), With>, // time: Res