From 743cdd5b2fe175605352c337396c3d70dac66247 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 7 Jan 2025 09:43:53 +0100 Subject: roll back player controller --- game/PlayerScript.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 game/PlayerScript.cpp (limited to 'game/PlayerScript.cpp') 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 + +using namespace crepe; +using namespace std; + +void PlayerScript::fixed_update(crepe::duration_t dt) { + Rigidbody & rb = this->get_components_by_name("player").front(); + if (this->get_key_state(Keycode::SPACE)) rb.add_force_linear(vec2(0, -10)); +} -- cgit v1.2.3