From d15de7503f2f7320e23863a11e97fcd401bc2eeb Mon Sep 17 00:00:00 2001 From: Max-001 Date: Tue, 24 Dec 2024 09:45:44 +0100 Subject: Moved Player files to seperate folder --- game/player/PlayerScript.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 game/player/PlayerScript.cpp (limited to 'game/player/PlayerScript.cpp') 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 + +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