aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-14 13:27:08 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-14 13:27:08 +0100
commit438f5301d8b14fa53fef73a4356f4a5171ac91af (patch)
treee3b0e4389c620a9b1d7224a7c390293c2ea01321 /src/example
parent644c1ee1a1f109ae293cc6b09fafe8ba8b448ff3 (diff)
parenta03f90fa9bcbd5a0c5b5d1f2e50df183c7c3640c (diff)
more WIP demo
Diffstat (limited to 'src/example')
-rw-r--r--src/example/demo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/example/demo.cpp b/src/example/demo.cpp
index d7adbdb..33f4d74 100644
--- a/src/example/demo.cpp
+++ b/src/example/demo.cpp
@@ -11,6 +11,11 @@ using namespace std;
class PlayerController : public Script {
void update() {
+ Rigidbody & body = get_component<Rigidbody>();
+
+ if (get_key_state(Keycode::SPACE)) {
+ body.add_force_linear({ 0, -1 });
+ }
}
};
@@ -52,6 +57,9 @@ class DemoScene : public Scene {
int main() {
Config::get_instance() = {
+ .physics = {
+ .gravity = 20,
+ },
.window = {
.size = {800, 800},
},