diff --git a/include/Cubed/gameplay/player.hpp b/include/Cubed/gameplay/player.hpp index 392bc75..d2258af 100644 --- a/include/Cubed/gameplay/player.hpp +++ b/include/Cubed/gameplay/player.hpp @@ -12,14 +12,15 @@ class World; class Player { private: - constexpr static float ACCELERATION = 25.0f; - constexpr static float DECELERATION = 40.0f; + constexpr static float ACCELERATION = 10.0f; + constexpr static float DECELERATION = 15.0f; + constexpr static float G = 22.5f; float m_yaw = 0.0f; float m_pitch = 0.0f; float m_sensitivity = 0.15f; - float m_speed = 5.0f; + float m_speed = 4.5f; // player is tow block tall, the pos is the lower pos glm::vec3 m_player_pos = glm::vec3(0.0f, 15.0f, 0.0f); diff --git a/src/gameplay/player.cpp b/src/gameplay/player.cpp index e9f59ea..0c31ad1 100644 --- a/src/gameplay/player.cpp +++ b/src/gameplay/player.cpp @@ -243,10 +243,7 @@ void Player::update(float delta_time) { static float down_speed = 0.0f; if (!m_world.is_block(glm::floor(m_player_pos)) && !m_move_state.up) { - down_speed += 25 * delta_time; - if (down_speed > 20.0f) { - down_speed = 20.0f; - } + down_speed += G * delta_time; m_player_pos -= glm::vec3(0.0f, 1.0f, 0.0f) * down_speed * delta_time; } else { down_speed = 0.0f;