diff --git a/README.md b/README.md index b3e9ae2..7c7889d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This game was written purely in [Rust](https://www.rust-lang.org/), and interfac ## The Team -This game is developed by a team of 8 students from *Sheridan College* and *Trent University*. +This game was developed by a team of 9 students from *Sheridan College* and *Trent University*. - [**Evan Pratten**](https://github.com/ewpratten) - Team lead @@ -39,5 +39,7 @@ This game is developed by a team of 8 students from *Sheridan College* and *Tren - Playtesting - [**James Feener**](https://twitter.com/jamesmakesgame) - Playtesting +- **Taya Armstrong** + - Playtesting A special thanks goes out to: [James Nickoli](https://github.com/rsninja722/) for insight on 2D collision detection, as well as [Ray](https://github.com/raysan5) and the members of the [raylib community](https://discord.gg/raylib) on discord for their support with the past two game jam projects. diff --git a/game/assets/levels/level_4/appearing_platforms.png b/game/assets/levels/level_4/appearing_platforms.png index 0b19b8e..09599ea 100644 Binary files a/game/assets/levels/level_4/appearing_platforms.png and b/game/assets/levels/level_4/appearing_platforms.png differ diff --git a/game/assets/levels/level_4/disappearing_platforms.png b/game/assets/levels/level_4/disappearing_platforms.png index 30f9e38..59e49eb 100644 Binary files a/game/assets/levels/level_4/disappearing_platforms.png and b/game/assets/levels/level_4/disappearing_platforms.png differ diff --git a/game/assets/levels/level_4/platforms.png b/game/assets/levels/level_4/platforms.png index 334a6f8..71db0c0 100644 Binary files a/game/assets/levels/level_4/platforms.png and b/game/assets/levels/level_4/platforms.png differ diff --git a/game/assets/levels/level_4/platforms.xcf b/game/assets/levels/level_4/platforms.xcf new file mode 100644 index 0000000..348b661 Binary files /dev/null and b/game/assets/levels/level_4/platforms.xcf differ diff --git a/game/src/scenes/ingame_scene/update.rs b/game/src/scenes/ingame_scene/update.rs index 520f78b..b4fed64 100644 --- a/game/src/scenes/ingame_scene/update.rs +++ b/game/src/scenes/ingame_scene/update.rs @@ -1,13 +1,10 @@ use std::ops::Div; use super::InGameScreen; -use crate::{ - character::CharacterState, - utilities::{non_ref_raylib::HackedRaylibHandle, render_layer::FrameUpdate}, - GameConfig, -}; +use crate::{GameConfig, character::CharacterState, utilities::{math::{interpolate_exp_unchecked, linear_interpolate}, non_ref_raylib::HackedRaylibHandle, render_layer::FrameUpdate}}; use chrono::Duration; use raylib::prelude::*; +use tracing::trace; impl FrameUpdate for InGameScreen { fn update( @@ -24,6 +21,8 @@ impl FrameUpdate for InGameScreen { // Set the camera's offset based on screen size self.camera.offset = raylib.get_screen_size().div(Vector2::new(2.0, 1.05)); self.camera.target = Vector2::new(self.player.position.x, self.camera.target.y); + self.camera.zoom = linear_interpolate(raylib.get_screen_size().y.max(200.0), 720.0..1016.0, 0.85..1.2); + trace!("Zoom level set to: {} {}", raylib.get_screen_size().y, self.camera.zoom); // Check the only possible keyboard inputs let is_jump = raylib.is_key_pressed(KeyboardKey::KEY_SPACE) diff --git a/game/src/utilities/math.rs b/game/src/utilities/math.rs index af975be..3d8f6f3 100644 --- a/game/src/utilities/math.rs +++ b/game/src/utilities/math.rs @@ -92,3 +92,10 @@ mod test { assert!(relative_eq!(actual_value, expected_value, epsilon = 0.001)); } } + + +pub fn linear_interpolate(value: f32, input_range: Range, output_range: Range) -> f32 { + let normalized_value = (value - input_range.start) / (input_range.end - input_range.start); + let mapped_value = (normalized_value * (output_range.end - output_range.start)) + output_range.start; + mapped_value +}