diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-07 09:43:53 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-07 09:43:53 +0100 |
commit | 743cdd5b2fe175605352c337396c3d70dac66247 (patch) | |
tree | 538c9713403f8746d629448190dc69305a15e82a /game/PlayerScript.cpp | |
parent | 8620f57f7101b2090add89330e74854b77161d3f (diff) |
roll back player controller
Diffstat (limited to 'game/PlayerScript.cpp')
-rw-r--r-- | game/PlayerScript.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/game/PlayerScript.cpp b/game/PlayerScript.cpp new file mode 100644 index 0000000..1c388f5 --- /dev/null +++ b/game/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)); +} |