From 62a91f57656f54bcafb996f255244e427fc601ca Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Fri, 17 Jan 2025 12:41:22 +0200 Subject: [PATCH 1/2] fix: clippy warnings --- src/camera.rs | 4 ++-- src/constants.rs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index 2701589..ec8362c 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -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; diff --git a/src/constants.rs b/src/constants.rs index 2ccdad5..771ec7c 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -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 From df4dcdf3cb51e000342afe37b0fbbffa97c31b05 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Fri, 17 Jan 2025 13:51:30 +0200 Subject: [PATCH 2/2] chore: bump version number --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/stats/systems/score.rs | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42968c9..fcfcd1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "maze-ascension" -version = "1.0.4" +version = "1.1.0" dependencies = [ "anyhow", "bevy", diff --git a/Cargo.toml b/Cargo.toml index 234db65..3a10a92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "maze-ascension" authors = ["Kristofers Solo "] -version = "1.0.4" +version = "1.1.0" edition = "2021" [dependencies] diff --git a/src/stats/systems/score.rs b/src/stats/systems/score.rs index 57b04e4..d0a98b4 100644 --- a/src/stats/systems/score.rs +++ b/src/stats/systems/score.rs @@ -20,7 +20,10 @@ pub fn update_score( return; } - score.0 = calculate_score(hightes_floor.0, floor_timer.elapsed_secs()); + score.0 = calculate_score( + hightes_floor.0.saturating_sub(1), + floor_timer.elapsed_secs(), + ); } pub fn update_score_display(