From a4576c3bab0901074c53209c141b2a767c60d38a Mon Sep 17 00:00:00 2001 From: Max-001 Date: Mon, 6 Jan 2025 09:56:37 +0100 Subject: Improved Player speed and velocity --- game/Config.h | 4 ++-- game/player/PlayerScript.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'game') diff --git a/game/Config.h b/game/Config.h index 973944e..1e51141 100644 --- a/game/Config.h +++ b/game/Config.h @@ -23,5 +23,5 @@ static constexpr int VIEWPORT_X = 1100; // In game units // 'GAME_HEIGHT' (below) should be replaced by '500' when game development is finished static constexpr int VIEWPORT_Y = GAME_HEIGHT; // In game units -static constexpr int PLAYER_SPEED = 100; // In game units -static constexpr int PLAYER_GRAVITY_SCALE = 40; // In game units +static constexpr int PLAYER_SPEED = 150; // In game units +static constexpr int PLAYER_GRAVITY_SCALE = 60; // In game units diff --git a/game/player/PlayerScript.cpp b/game/player/PlayerScript.cpp index 3b4cc5e..c4ed6a0 100644 --- a/game/player/PlayerScript.cpp +++ b/game/player/PlayerScript.cpp @@ -80,7 +80,7 @@ void PlayerScript::fixed_update(crepe::duration_t dt) { Rigidbody & rb = this->get_components_by_name("player").front(); if (this->get_key_state(Keycode::SPACE)) { - rb.add_force_linear(vec2(0, -PLAYER_GRAVITY_SCALE / 3)); + rb.add_force_linear(vec2(0, -PLAYER_GRAVITY_SCALE / 2.5)); if (prev_anim != 1) { for (Animator & anim : animators) { anim.active = true; -- cgit v1.2.3