mirror of
https://github.com/kristoferssolo/maze-ascension.git
synced 2025-10-21 19:20:34 +00:00
fix: clippy warnings
This commit is contained in:
parent
48a39d4430
commit
62a91f5765
@ -1,6 +1,6 @@
|
||||
use bevy::{input::mouse::MouseWheel, prelude::*};
|
||||
|
||||
use crate::constants::{BASE_ZOOM_SPEED, DISTANCE_SCALE_FACTOR, MAX_ZOOM, MIN_ZOOM};
|
||||
use crate::constants::{BASE_ZOOM_SPEED, MAX_ZOOM, MIN_ZOOM};
|
||||
|
||||
pub(super) fn plugin(app: &mut App) {
|
||||
app.add_systems(Update, camera_zoom);
|
||||
@ -39,7 +39,7 @@ fn camera_zoom(
|
||||
let current_distance = transform.translation.length();
|
||||
|
||||
// Calculate zoom speed based on distance
|
||||
let distance_multiplier = (current_distance / MIN_ZOOM).powf(DISTANCE_SCALE_FACTOR);
|
||||
let distance_multiplier = (current_distance / MIN_ZOOM).sqrt();
|
||||
let adjusted_zoom_speed = BASE_ZOOM_SPEED * distance_multiplier;
|
||||
|
||||
let mut zoom_delta = 0.0;
|
||||
|
||||
@ -17,4 +17,3 @@ pub const TIME_REFERENCE_SECONDS: f32 = 60.0; // Reference time for score calcul
|
||||
pub const BASE_ZOOM_SPEED: f32 = 10.0;
|
||||
pub const MIN_ZOOM: f32 = 50.0;
|
||||
pub const MAX_ZOOM: f32 = 2500.0;
|
||||
pub const DISTANCE_SCALE_FACTOR: f32 = 0.5; // Adjust this to control how much distance affects zoom speed
|
||||
|
||||
Loading…
Reference in New Issue
Block a user