aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-14 13:29:52 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-14 13:29:52 +0100
commitdd89b381c212aa55a4e9d7bc7eea014e992956ef (patch)
tree741f427d183ab47db265a68f534ed6dc5b46a08f /src
parent1a5116b944bcbdeeb3474faefbe150e82f8697b1 (diff)
used add force in game.cpp
Diffstat (limited to 'src')
-rw-r--r--src/example/game.cpp5
1 files changed, 3 insertions, 2 deletions
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<Rigidbody>();
- 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