From dd89b381c212aa55a4e9d7bc7eea014e992956ef Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Sat, 14 Dec 2024 13:29:52 +0100 Subject: used add force in game.cpp --- src/example/game.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/example') diff --git a/src/example/game.cpp b/src/example/game.cpp index 60c9088..d03d78d 100644 --- a/src/example/game.cpp +++ b/src/example/game.cpp @@ -35,7 +35,8 @@ class MyScript1 : public Script { } case Keycode::W: { Rigidbody & tf = this->get_component(); - tf.data.linear_velocity.y -= 1; + // tf.data.linear_velocity.y -= 1; + tf.add_force_linear({0,-1}); break; } case Keycode::S: { @@ -197,7 +198,7 @@ public: .body_type = Rigidbody::BodyType::DYNAMIC, .linear_velocity = {0, 1}, .constraints = {0, 0, 0}, - .elastisity_coefficient = 1, + .elastisity_coefficient = 0, .offset = {0, 0}, }); // add box with boxcollider -- cgit v1.2.3