From dc9af733c3e8f11d73fa62028e3b72cee7a73c36 Mon Sep 17 00:00:00 2001 From: max-001 Date: Thu, 19 Dec 2024 10:33:09 +0100 Subject: Fixed gravity --- src/example/Player.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/example/Player.cpp b/src/example/Player.cpp index 73f0275..49dfa2d 100644 --- a/src/example/Player.cpp +++ b/src/example/Player.cpp @@ -13,8 +13,7 @@ class PlayerScript : public Script { public: void update() { Rigidbody & rb = this->get_components_by_name("player").front(); - if (this->get_key_state(Keycode::SPACE)) - rb.add_force_linear(vec2(0, -10)); + if (this->get_key_state(Keycode::SPACE)) rb.add_force_linear(vec2(0, -10)); } }; @@ -60,7 +59,7 @@ Player::Player(Scene & scn) { .looping = true, }); player.add_component(Rigidbody::Data{ - .gravity_scale = 10, + .gravity_scale = 20, .body_type = Rigidbody::BodyType::DYNAMIC, .linear_velocity = vec2(100, 0), }); -- cgit v1.2.3