diff --git a/src/bin/platformer/graphics.rs b/src/bin/platformer/graphics.rs index c782d9a..5241ba2 100644 --- a/src/bin/platformer/graphics.rs +++ b/src/bin/platformer/graphics.rs @@ -184,7 +184,7 @@ impl Graphics { let world_model_mat = Mat4::IDENTITY; self.passes [0].with (gl_state, || { - glezz::clear_color (0.5f32, 0.5f32, 0.5f32, 1.0f32); + glezz::clear_color (109f32 / 255.0, 194f32 / 255.0, 202f32 / 255.0, 1.0f32); glezz::clear (gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT | gl::STENCIL_BUFFER_BIT); }); @@ -192,6 +192,9 @@ impl Graphics { let attrs = shader_vars.attrs; let unis = shader_vars.unis; + glezz::uniform_3fv (unis [&u::ALBEDO], &white); + glezz::uniform_3fv (unis [&u::MIN_BRIGHT], &white); + if true { self.texture_earth.bind (); @@ -354,7 +357,7 @@ impl Graphics { } } - if true { + if false { let sky_mvp_mat = view_mat * Mat4::from_scale ((64.0, 64.0, 64.0).into ()); self.texture_sky.bind (); diff --git a/src/bin/platformer/main.rs b/src/bin/platformer/main.rs index 5ac0834..243eb22 100644 --- a/src/bin/platformer/main.rs +++ b/src/bin/platformer/main.rs @@ -150,7 +150,7 @@ async fn main () -> Result <()> { let mut game_state = GameState::default (); let phys_params = opengl_rust::physics::Params { dt: 1.0 / 60.0, - gravity: (0.0, 0.0, -0.25).into (), + gravity: (0.0, 0.0, -0.5).into (), margin: 0.00125, }; @@ -184,10 +184,15 @@ async fn main () -> Result <()> { let kb_state = event_pump.keyboard_state (); - let player_speed = if player_jump_vec.is_some () { - game_state.player.vel.x = 0.0; - game_state.player.vel.y = 0.0; - player_speed + let player_speed = if let Some (v) = player_jump_vec.as_ref () { + if v.z > 0.5 { + game_state.player.vel.x = 0.0; + game_state.player.vel.y = 0.0; + player_speed + } + else { + 0.125 + } } else { 0.125