aboutsummaryrefslogtreecommitdiff
path: root/game/preview/PrevPlayerScript.h
diff options
context:
space:
mode:
authorMax-001 <maxsmits21@kpnmail.nl>2025-01-11 11:35:33 +0100
committerMax-001 <maxsmits21@kpnmail.nl>2025-01-11 11:35:33 +0100
commit46aec26cae3d2d405aac64e69bbba74944cd7a7b (patch)
treefeb80d722c670de3e18922c57137febfc96e9d3e /game/preview/PrevPlayerScript.h
parentd557cfd311a6239e579fad35e3684f8c0e170ce7 (diff)
Fix: Made player much more responsive
Diffstat (limited to 'game/preview/PrevPlayerScript.h')
-rw-r--r--game/preview/PrevPlayerScript.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/game/preview/PrevPlayerScript.h b/game/preview/PrevPlayerScript.h
index cc3184e..ae66449 100644
--- a/game/preview/PrevPlayerScript.h
+++ b/game/preview/PrevPlayerScript.h
@@ -1,10 +1,10 @@
-
+#include <crepe/api/Animator.h>
+#include <crepe/api/Config.h>
#include <crepe/api/Event.h>
+#include <crepe/api/Rigidbody.h>
#include <crepe/api/Script.h>
-#include <crepe/util/OptionalRef.h>
-
-#include <crepe/api/Animator.h>
#include <crepe/api/Sprite.h>
+#include <crepe/util/OptionalRef.h>
class PrevPlayerScript : public crepe::Script {
private:
@@ -20,4 +20,13 @@ private:
void init();
void fixed_update(crepe::duration_t dt);
bool key_pressed(const crepe::KeyPressEvent & ev);
+
+private:
+ bool on_key_down(const crepe::KeyPressEvent & ev);
+ bool on_key_up(const crepe::KeyReleaseEvent & ev);
+ void help_kick(const crepe::vec2 & direction);
+
+private:
+ float & engine_gravity = crepe::Config::get_instance().physics.gravity;
+ crepe::OptionalRef<crepe::Rigidbody> rb;
};