Merge branch 'master' into levels
This commit is contained in:
commit
0341c93b53
@ -13,7 +13,7 @@ This game was written purely in [Rust](https://www.rust-lang.org/), and interfac
|
|||||||
|
|
||||||
## The Team
|
## 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)
|
- [**Evan Pratten**](https://github.com/ewpratten)
|
||||||
- Team lead
|
- Team lead
|
||||||
@ -39,5 +39,7 @@ This game is developed by a team of 8 students from *Sheridan College* and *Tren
|
|||||||
- Playtesting
|
- Playtesting
|
||||||
- [**James Feener**](https://twitter.com/jamesmakesgame)
|
- [**James Feener**](https://twitter.com/jamesmakesgame)
|
||||||
- Playtesting
|
- 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.
|
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.
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 84 KiB |
Binary file not shown.
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 61 KiB |
Binary file not shown.
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 82 KiB |
BIN
game/assets/levels/level_4/platforms.xcf
Normal file
BIN
game/assets/levels/level_4/platforms.xcf
Normal file
Binary file not shown.
@ -1,13 +1,10 @@
|
|||||||
use std::ops::Div;
|
use std::ops::Div;
|
||||||
|
|
||||||
use super::InGameScreen;
|
use super::InGameScreen;
|
||||||
use crate::{
|
use crate::{GameConfig, character::CharacterState, utilities::{math::{interpolate_exp_unchecked, linear_interpolate}, non_ref_raylib::HackedRaylibHandle, render_layer::FrameUpdate}};
|
||||||
character::CharacterState,
|
|
||||||
utilities::{non_ref_raylib::HackedRaylibHandle, render_layer::FrameUpdate},
|
|
||||||
GameConfig,
|
|
||||||
};
|
|
||||||
use chrono::Duration;
|
use chrono::Duration;
|
||||||
use raylib::prelude::*;
|
use raylib::prelude::*;
|
||||||
|
use tracing::trace;
|
||||||
|
|
||||||
impl FrameUpdate for InGameScreen {
|
impl FrameUpdate for InGameScreen {
|
||||||
fn update(
|
fn update(
|
||||||
@ -24,6 +21,8 @@ impl FrameUpdate for InGameScreen {
|
|||||||
// Set the camera's offset based on screen size
|
// 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.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.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
|
// Check the only possible keyboard inputs
|
||||||
let is_jump = raylib.is_key_pressed(KeyboardKey::KEY_SPACE)
|
let is_jump = raylib.is_key_pressed(KeyboardKey::KEY_SPACE)
|
||||||
|
@ -92,3 +92,10 @@ mod test {
|
|||||||
assert!(relative_eq!(actual_value, expected_value, epsilon = 0.001));
|
assert!(relative_eq!(actual_value, expected_value, epsilon = 0.001));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pub fn linear_interpolate(value: f32, input_range: Range<f32>, output_range: Range<f32>) -> 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
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user