Skip to content

Commit 8490f60

Browse files
author
Carter Hollman
committed
fix:formatting
1 parent 37ed698 commit 8490f60

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

game/src/camera/camera_plugin.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use bevy::{input::mouse::MouseWheel, prelude::*};
21
use avian2d::prelude::*;
2+
use bevy::{input::mouse::MouseWheel, prelude::*};
33

44
pub struct CameraPlugin;
55

@@ -14,8 +14,12 @@ pub struct MainCamera;
1414
impl Plugin for CameraPlugin {
1515
fn build(&self, app: &mut App) {
1616
app.add_systems(Startup, setup_main_camera);
17-
app.add_systems(PostUpdate, update_camera.after(PhysicsSet::Sync)
18-
.before(TransformSystem::TransformPropagate));
17+
app.add_systems(
18+
PostUpdate,
19+
update_camera
20+
.after(PhysicsSet::Sync)
21+
.before(TransformSystem::TransformPropagate),
22+
);
1923
app.add_systems(Update, zoom_camera);
2024
}
2125
}
@@ -30,7 +34,6 @@ fn update_camera(
3034
mut camera_query: Query<&mut Transform, (With<MainCamera>, Without<CameraTarget>)>,
3135
target_query: Query<&Transform, (With<CameraTarget>, Without<MainCamera>)>,
3236
) {
33-
3437
let Ok(mut camera) = camera_query.get_single_mut() else {
3538
error!("could not execute query for single MainCamera component");
3639
return;
@@ -41,10 +44,8 @@ fn update_camera(
4144
return;
4245
};
4346

44-
4547
let Vec3 { x, y, .. } = target.translation;
4648

47-
4849
let direction = Vec3::new(x, y, camera.translation.z);
4950

5051
camera.translation = direction;
@@ -61,12 +62,10 @@ fn zoom_camera(
6162
//Amount to zoom in this update cycle
6263
let mut zoom_amount = 0.0;
6364

64-
6565
for event in scroll_event.read() {
6666
zoom_amount += -event.y * zoom_factor
6767
}
6868

69-
7069
if zoom_amount != 0.0 {
7170
for mut projection in camera.iter_mut() {
7271
projection.scale += zoom_amount;

game/src/debug/debug_plugin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@ impl Plugin for DebugPlugin {
1616
fn print_debug_active_message() {
1717
info!("The debugger is active!");
1818
}
19-
20-

0 commit comments

Comments
 (0)