diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-19 10:33:09 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-19 10:33:09 +0100 |
commit | dc9af733c3e8f11d73fa62028e3b72cee7a73c36 (patch) | |
tree | 1a965332cd9440f640315e077e9b9b697c5a0e72 /src/example | |
parent | f58b920da434c6eb67f7e439277d7fb2eaa4f2e0 (diff) |
Fixed gravity
Diffstat (limited to 'src/example')
-rw-r--r-- | src/example/Player.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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<Rigidbody>("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>(Rigidbody::Data{ - .gravity_scale = 10, + .gravity_scale = 20, .body_type = Rigidbody::BodyType::DYNAMIC, .linear_velocity = vec2(100, 0), }); |