From db28c7403bb1148ac1e813c86bd2ff800ca6569d Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 2 Oct 2021 18:48:58 -0400 Subject: [PATCH 1/3] debug collider rendering --- game/src/lib.rs | 3 ++- game/src/scenes/ingame_scene/world.rs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/game/src/lib.rs b/game/src/lib.rs index 3dc760f..d6a98ca 100644 --- a/game/src/lib.rs +++ b/game/src/lib.rs @@ -74,7 +74,7 @@ use std::{cell::RefCell, sync::mpsc::TryRecvError}; use discord_sdk::activity::ActivityBuilder; use raylib::prelude::*; -use tracing::{error, info}; +use tracing::{error, info, warn}; use utilities::discord::DiscordConfig; use crate::{ @@ -224,6 +224,7 @@ pub async fn game_begin(game_config: &mut GameConfig) -> Result<(), Box Date: Sat, 2 Oct 2021 18:55:38 -0400 Subject: [PATCH 2/3] bg rendering --- game/assets/levels/level_0/background.png | Bin 47431 -> 36137 bytes game/src/scenes/ingame_scene/level/loader.rs | 11 +++++------ game/src/scenes/ingame_scene/level/mod.rs | 4 +++- game/src/scenes/ingame_scene/world.rs | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/game/assets/levels/level_0/background.png b/game/assets/levels/level_0/background.png index 8fc5cff748145d10ab11fe1235d45e91b45fbec6..1e6e4386669458218a142e67d43e765da3624c8d 100644 GIT binary patch literal 36137 zcmeHQ3p|wB`yYhpqU|P1rV(MA8FOQ1T+6*&Q;MR-m|?;UGvit#D(yxkYRj!m7i2?8 zv}|g%L>HH^L{Z72n=ULh7XLFdDs9xi&u+hMci()xGw*qy^PF>@=Q&^J@_kP`9qcTp z$ScdkV6Z9HR%R<;Fxd#4L#EcE;6(`afJtjbC6hPg2+J{tURxxmDWv$Jx|f!^5mL zRik)#-hr2iXqK1O#x8{4bJ_%k@ zo$7yKsN=C5XV2WCHc2<-ZvF+n@6(s&MJ-KFPXB~_QQgD4U2q*4dE=H<=xW_!R&v>=bM$PdIy2<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w1H@Up6HCYb z4HHW%;GbA}U5PVwosNOhPn0!LO6?$Y{W<0=q|^>5?8S2*7@GbLrS|{d)!BCdb#^>_ zpnqpI`Ohb-2c?6bo7Duq#{|gI(yh$^1}|d()Y$=X_Ae;TW?S&+5fE%yl09)u?a!P~ zXujjWM|~EO%3D*PMRW9~{*cPcfNRbK>a**pK^Z9hpA6j8;6HVoltAjUAhea3{{6p5 zeHPVnf=7Ke$LS|{v<*P#6kmHL!2Z^ggSP+2^@snW4Ojs)owW*(gC)^|G<+EG6rP7A ztp2Sx^E3=INEOKc;GJYz?r)f6`p#c$&Qw`P2TFrsC}Ns3(Ms(gjQu(NAE49@32}Yj zaq{1#)E)wq+VLnE{5z}3e@=V&=~+$SmGZ!BU{G%+G#i+S7u>8Sc_{gx?7(`Mu7&!a znC}=+v2(6lVK#zAS3|K&KFO)vKNo+;iOM=z+3z||Uct%AR{kJl@Cu^Q=KK|{Jl&t{ z&Q$jzb(w^l7qcFkCmn8TO(6QCo}~&@xz?2JvGs8QC4)?SJlcAUSl(%v_Dt1$;BkLK z^#?-!@CnNT>~Fo4LCAkxfA}xjKoQiNStOYXEBOP`aQqD?ncq}pSzvSwSbHq8@J%u; zo(iZ}nAS@y-0!5HnPl4FCnlL*Co7w=PRO7YhX09?l|?DF10e(aO6@4>EKq9yQ7f+l wraSYWr__D|D7EYVJF5w*KkXkJPKOwn(_9Xn;;AEt8h2!+6i?*-W*GSY0RWV)m;e9( diff --git a/game/src/scenes/ingame_scene/level/loader.rs b/game/src/scenes/ingame_scene/level/loader.rs index 3ca4add..8680ae3 100644 --- a/game/src/scenes/ingame_scene/level/loader.rs +++ b/game/src/scenes/ingame_scene/level/loader.rs @@ -1,9 +1,6 @@ use raylib::{RaylibHandle, RaylibThread}; -use crate::{ - utilities::datastore::{load_texture_from_internal_data, ResourceLoadError}, - StaticGameData, -}; +use crate::{StaticGameData, utilities::{datastore::{load_texture_from_internal_data, ResourceLoadError}, world_paint_texture::WorldPaintTexture}}; use super::Level; @@ -26,13 +23,15 @@ pub fn load_all_levels( let mut levels = Vec::new(); for level_name in &level_names { + + levels.push(Level { name: level_name.to_string(), - background_tex: load_texture_from_internal_data( + background_tex: WorldPaintTexture::new(load_texture_from_internal_data( raylib_handle, thread, &format!("levels/{}/background.png", level_name), - )?, + )?), platform_tex: load_texture_from_internal_data( raylib_handle, thread, diff --git a/game/src/scenes/ingame_scene/level/mod.rs b/game/src/scenes/ingame_scene/level/mod.rs index 2119b36..1c48789 100644 --- a/game/src/scenes/ingame_scene/level/mod.rs +++ b/game/src/scenes/ingame_scene/level/mod.rs @@ -1,11 +1,13 @@ use raylib::{math::Rectangle, texture::Texture2D}; +use crate::utilities::world_paint_texture::WorldPaintTexture; + pub mod loader; #[derive(Debug)] pub struct Level { pub name: String, - pub background_tex: Texture2D, + pub background_tex: WorldPaintTexture, pub platform_tex: Texture2D, pub colliders: Vec } diff --git a/game/src/scenes/ingame_scene/world.rs b/game/src/scenes/ingame_scene/world.rs index 7a46244..817c4ca 100644 --- a/game/src/scenes/ingame_scene/world.rs +++ b/game/src/scenes/ingame_scene/world.rs @@ -22,7 +22,7 @@ impl WorldSpaceRender for InGameScreen { let cur_level = self.levels.get(self.current_level_idx).unwrap(); // Render the world background - // self.world_background.render(raylib, Vector2::new(0.0, -1080.0), &self.camera); + cur_level.background_tex.render(raylib, Vector2::new(0.0, -1080.0), &self.camera); // Render the platform layer raylib.draw_texture_v( From 3bc21a4a3a8322fc02f9df3634b2fab34e29686a Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 2 Oct 2021 19:11:32 -0400 Subject: [PATCH 3/3] Add death --- game/src/character/collisions.rs | 7 +++-- game/src/character/mod.rs | 15 ++++++++--- game/src/scenes/ingame_scene/mod.rs | 15 ++++++++++- game/src/scenes/ingame_scene/update.rs | 36 +++++++++++++++++++------- 4 files changed, 57 insertions(+), 16 deletions(-) diff --git a/game/src/character/collisions.rs b/game/src/character/collisions.rs index c802015..13ce222 100644 --- a/game/src/character/collisions.rs +++ b/game/src/character/collisions.rs @@ -8,6 +8,7 @@ use super::{CharacterState, MainCharacter}; pub const GRAVITY_PPS: f32 = 2.0; +#[must_use] pub fn modify_player_based_on_forces( player: &mut MainCharacter, colliders: &Vec, @@ -56,16 +57,18 @@ pub fn modify_player_based_on_forces( if player.current_state == CharacterState::Jumping || player.current_state == CharacterState::Dashing { - player.update_player( + return player.update_player( Some(CharacterState::Running), colliders, level_height_offset, ); - return Ok(()); } } // Check sideways collisions + if player.velocity.y == 0.0 && check_player_colliding_with_colliders(){ + return Err(()); + } // Finally apply the velocity to the player player.position += player.velocity; diff --git a/game/src/character/mod.rs b/game/src/character/mod.rs index 9c1b0d2..872d7fb 100644 --- a/game/src/character/mod.rs +++ b/game/src/character/mod.rs @@ -38,7 +38,7 @@ impl MainCharacter { movement_force: Vector2::zero(), velocity: Vector2::zero(), base_velocity: Vector2::new(0.0, GRAVITY_PPS), - size: Vector2::new(100.0, 100.0), + size: Vector2::new(80.0, 100.0), sprite_sheet: AnimatedSpriteSheet::new( sprite_sheet, Vector2::new(300.0, 300.0), @@ -51,12 +51,13 @@ impl MainCharacter { } } + #[must_use] pub fn update_player( &mut self, state: Option, colliders: &Vec, level_height_offset: f32, - ) { + ) -> Result<(), ()> { if let Some(state) = state { // Update the internal state if state != self.current_state { @@ -73,6 +74,14 @@ impl MainCharacter { } // Update the player based on the new velocity - modify_player_based_on_forces(self, colliders, level_height_offset).unwrap(); + modify_player_based_on_forces(self, colliders, level_height_offset) + } + + pub fn reset(&mut self) { + self.position = Vector2::new(0.0, 0.0); + self.velocity = Vector2::zero(); + self.movement_force = Vector2::zero(); + self.current_state = CharacterState::default(); + self.state_set_timestamp = Utc::now(); } } diff --git a/game/src/scenes/ingame_scene/mod.rs b/game/src/scenes/ingame_scene/mod.rs index bfe505e..af5e290 100644 --- a/game/src/scenes/ingame_scene/mod.rs +++ b/game/src/scenes/ingame_scene/mod.rs @@ -28,6 +28,7 @@ pub struct InGameScreen { world_background: WorldPaintTexture, levels: Vec, current_level_idx: usize, + player_dead: bool, } impl InGameScreen { @@ -48,6 +49,7 @@ impl InGameScreen { world_background: WorldPaintTexture::new(background_texture), levels, current_level_idx: 0, + player_dead: false, } } } @@ -63,7 +65,7 @@ impl Action for InGameScreen { // Set the player to running let cur_level = self.levels.get(self.current_level_idx).unwrap(); - self.player.update_player( + let _ = self.player.update_player( Some(CharacterState::Running), &cur_level.colliders, -cur_level.platform_tex.height as f32, @@ -112,6 +114,10 @@ impl Action for InGameScreen { if renderer.is_key_pressed(KeyboardKey::KEY_ESCAPE) { Ok(ActionFlag::SwitchState(Scenes::PauseScreen)) + } else if self.player_dead { + + // TODO: (luna) make this switch to the death screen plz + Ok(ActionFlag::SwitchState(Scenes::FsmErrorScreen)) } else { Ok(ActionFlag::Continue) } @@ -119,6 +125,13 @@ impl Action for InGameScreen { fn on_finish(&mut self, _interrupted: bool) -> Result<(), ScreenError> { debug!("Finished InGameScreen"); + + // Handle resetting if the player dies + if self.player_dead { + self.player_dead = false; + self.player.reset(); + } + Ok(()) } } diff --git a/game/src/scenes/ingame_scene/update.rs b/game/src/scenes/ingame_scene/update.rs index 754dbc2..2b16ea5 100644 --- a/game/src/scenes/ingame_scene/update.rs +++ b/game/src/scenes/ingame_scene/update.rs @@ -21,7 +21,6 @@ impl FrameUpdate for InGameScreen { // Get the current level let cur_level = self.levels.get(self.current_level_idx).unwrap(); - // 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); @@ -32,22 +31,39 @@ impl FrameUpdate for InGameScreen { let is_dash = raylib.is_key_pressed(KeyboardKey::KEY_LEFT_SHIFT) && !(self.player.current_state == CharacterState::Dashing); - if is_jump { - self.player.update_player(Some(CharacterState::Jumping), &cur_level.colliders, - -cur_level.platform_tex.height as f32,); + let collision_result = if is_jump { + self.player.update_player( + Some(CharacterState::Jumping), + &cur_level.colliders, + -cur_level.platform_tex.height as f32, + ) } else if is_dash { - self.player.update_player(Some(CharacterState::Dashing), &cur_level.colliders, - -cur_level.platform_tex.height as f32,); + self.player.update_player( + Some(CharacterState::Dashing), + &cur_level.colliders, + -cur_level.platform_tex.height as f32, + ) } else { if self.player.current_state != CharacterState::Jumping && self.player.current_state != CharacterState::Dashing { - self.player.update_player(Some(CharacterState::Running), &cur_level.colliders, - -cur_level.platform_tex.height as f32,); + self.player.update_player( + Some(CharacterState::Running), + &cur_level.colliders, + -cur_level.platform_tex.height as f32, + ) } else { - self.player.update_player(None, &cur_level.colliders, - -cur_level.platform_tex.height as f32,); + self.player.update_player( + None, + &cur_level.colliders, + -cur_level.platform_tex.height as f32, + ) } + }; + + // Handle running into a wall + if let Err(_) = collision_result { + self.player_dead = true; } } }