mirror of
https://github.com/kristoferssolo/maze-ascension.git
synced 2025-10-21 19:20:34 +00:00
Merge pull request #38 from kristoferssolo/fix/clippy
This commit is contained in:
commit
e1fa12b6b9
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3157,7 +3157,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "maze-ascension"
|
name = "maze-ascension"
|
||||||
version = "1.0.4"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bevy",
|
"bevy",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "maze-ascension"
|
name = "maze-ascension"
|
||||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||||
version = "1.0.4"
|
version = "1.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use bevy::{input::mouse::MouseWheel, prelude::*};
|
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) {
|
pub(super) fn plugin(app: &mut App) {
|
||||||
app.add_systems(Update, camera_zoom);
|
app.add_systems(Update, camera_zoom);
|
||||||
@ -39,7 +39,7 @@ fn camera_zoom(
|
|||||||
let current_distance = transform.translation.length();
|
let current_distance = transform.translation.length();
|
||||||
|
|
||||||
// Calculate zoom speed based on distance
|
// 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 adjusted_zoom_speed = BASE_ZOOM_SPEED * distance_multiplier;
|
||||||
|
|
||||||
let mut zoom_delta = 0.0;
|
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 BASE_ZOOM_SPEED: f32 = 10.0;
|
||||||
pub const MIN_ZOOM: f32 = 50.0;
|
pub const MIN_ZOOM: f32 = 50.0;
|
||||||
pub const MAX_ZOOM: f32 = 2500.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
|
|
||||||
|
|||||||
@ -20,7 +20,10 @@ pub fn update_score(
|
|||||||
return;
|
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(
|
pub fn update_score_display(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user