Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
naomijub committed Dec 5, 2023
1 parent 718ea94 commit 77b3d45
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/player.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{prelude::*, window::PrimaryWindow, input::mouse::MouseWheel};
use bevy::{input::mouse::MouseWheel, prelude::*, window::PrimaryWindow};

use crate::{get_sprite_rotation, physics::Velocity};

Expand Down Expand Up @@ -29,7 +29,6 @@ impl Plugin for PlayerPlugin {
)
.add_systems(Update, (change_movement_style, bark))
.add_systems(Update, (set_cam_distance, camera_movement));

}
}

Expand Down Expand Up @@ -211,7 +210,7 @@ fn player_movemnt_by_wasd(
fn camera_movement(
mut camera_query: Query<(&mut Transform, &mut CameraDistance), With<Camera>>,
player_query: Query<&Transform, (With<Player>, Without<Camera>)>,
time : Res<Time>,
time: Res<Time>,
mut scroll_evr: EventReader<MouseWheel>,
) {
let Ok((mut camera, mut distance)) = camera_query.get_single_mut() else {
Expand Down Expand Up @@ -243,10 +242,10 @@ fn camera_movement(

fn set_cam_distance(
mut commands: Commands,
camera_without_dist : Query<(Entity, &Transform), (With<Camera>, Without<CameraDistance>)>,
player_query: Query<&Transform, With<Player>>
camera_without_dist: Query<(Entity, &Transform), (With<Camera>, Without<CameraDistance>)>,
player_query: Query<&Transform, With<Player>>,
) {
let Ok( player) = player_query.get_single() else {
let Ok(player) = player_query.get_single() else {
return;
};

Expand All @@ -257,4 +256,4 @@ fn set_cam_distance(
let dist = (player.translation - camera.translation).dot(camera.forward());

commands.entity(e).insert(CameraDistance(dist));
}
}

0 comments on commit 77b3d45

Please sign in to comment.