aboutsummaryrefslogtreecommitdiff
path: root/game/player/PlayerScript.cpp
diff options
context:
space:
mode:
authorMax-001 <maxsmits21@kpnmail.nl>2024-12-24 09:45:44 +0100
committerMax-001 <maxsmits21@kpnmail.nl>2024-12-24 09:45:44 +0100
commitd15de7503f2f7320e23863a11e97fcd401bc2eeb (patch)
tree08f318d3a36dedd9851be43e7aae22a8b2f603a9 /game/player/PlayerScript.cpp
parent61148c757a1f742ff09e40e5347e74e638c7371c (diff)
Moved Player files to seperate folder
Diffstat (limited to 'game/player/PlayerScript.cpp')
-rw-r--r--game/player/PlayerScript.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/game/player/PlayerScript.cpp b/game/player/PlayerScript.cpp
new file mode 100644
index 0000000..1c388f5
--- /dev/null
+++ b/game/player/PlayerScript.cpp
@@ -0,0 +1,11 @@
+#include "PlayerScript.h"
+
+#include <crepe/api/Rigidbody.h>
+
+using namespace crepe;
+using namespace std;
+
+void PlayerScript::fixed_update(crepe::duration_t dt) {
+ Rigidbody & rb = this->get_components_by_name<Rigidbody>("player").front();
+ if (this->get_key_state(Keycode::SPACE)) rb.add_force_linear(vec2(0, -10));
+}