aboutsummaryrefslogtreecommitdiff
path: root/src/example/MoveCameraManualyScript.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-20 12:52:15 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-20 12:52:15 +0100
commit6570bf598a3b3768fe34827529df5ea0b4b26f0e (patch)
tree863f6520fd13017dffa5e01ce6b0f60770b4c505 /src/example/MoveCameraManualyScript.cpp
parent43c6971591aaff8ada4adc1b1b4146b19d43f8e9 (diff)
move game files
Diffstat (limited to 'src/example/MoveCameraManualyScript.cpp')
-rw-r--r--src/example/MoveCameraManualyScript.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/example/MoveCameraManualyScript.cpp b/src/example/MoveCameraManualyScript.cpp
deleted file mode 100644
index 0181333..0000000
--- a/src/example/MoveCameraManualyScript.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "MoveCameraManualyScript.h"
-
-using namespace crepe;
-using namespace std;
-
-void MoveCameraManualyScript::init() {
- subscribe<KeyPressEvent>(
- [this](const KeyPressEvent & ev) -> bool { return this->keypressed(ev); });
-}
-
-bool MoveCameraManualyScript::keypressed(const KeyPressEvent & event) {
- if (event.key == Keycode::RIGHT) {
- Transform & cam = this->get_components_by_name<Transform>("camera").front();
- cam.position.x += 100;
- return true;
- } else if (event.key == Keycode::LEFT) {
- Transform & cam = this->get_components_by_name<Transform>("camera").front();
- cam.position.x -= 100;
- return true;
- }
- return false;
-}