diff --git a/assets/img/map/darkness.png b/assets/img/map/darkness.png index bca5ae6..33450f0 100644 Binary files a/assets/img/map/darkness.png and b/assets/img/map/darkness.png differ diff --git a/src/items.rs b/src/items.rs index 81515c9..547477e 100644 --- a/src/items.rs +++ b/src/items.rs @@ -32,7 +32,7 @@ pub struct Flashlight { impl Flashlight { pub fn lvl1() -> Self { Self { - radius: 120.0 + radius: 0.25 } } } diff --git a/src/logic/ingame/mod.rs b/src/logic/ingame/mod.rs index 5e161f7..3f2bce6 100644 --- a/src/logic/ingame/mod.rs +++ b/src/logic/ingame/mod.rs @@ -104,21 +104,16 @@ impl InGameScreen { // Get the window center let win_height = draw_handle.get_screen_height(); let win_width = draw_handle.get_screen_width(); - let window_center = Vector2 { - x: (win_width as f32 / 2.0), - y: (win_height as f32 / 2.0), - }; // Calculate the occusion radius based on depth - let radius = (win_width as f32 - * (1.0 - - (game_core.player.calculate_depth_percent(&game_core.world) * 1.3) - .clamp(0.0, 1.0))) + let radius = (1.0 + - (game_core.player.calculate_depth_percent(&game_core.world) * 1.3).clamp(0.0, 1.0)) .max(min_radius); // Determine width and height scales - let width_scale = 5.0; - let height_scale = 5.0; + // This is clamped to make the rendering logic below easier by removing the need to overdraw + let width_scale = (5.0 * radius).max(0.5); + let height_scale = (5.0 * radius).max(0.5); // Get the base sizes of everything let texture_width = game_core.resources.darkness_overlay.width as f32; @@ -132,7 +127,7 @@ impl InGameScreen { Rectangle { x: 0.0, y: 0.0, - width:texture_width, + width: texture_width, height: texture_height, }, Rectangle { @@ -145,17 +140,6 @@ impl InGameScreen { 0.0, Color::WHITE, ); - - // Render the overlay - // draw_handle.draw_ring( - // window_center, - // radius, - // win_width as f32, - // 0, - // 360, - // 128, - // Color::BLACK, - // ); } }