diff options
Diffstat (limited to 'src/example/PlayerSubScene.cpp')
-rw-r--r-- | src/example/PlayerSubScene.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/example/PlayerSubScene.cpp b/src/example/PlayerSubScene.cpp index 180ca17..7d9526b 100644 --- a/src/example/PlayerSubScene.cpp +++ b/src/example/PlayerSubScene.cpp @@ -1,4 +1,5 @@ #include "PlayerSubScene.h" +#include "PlayerScript.h" #include <crepe/api/Animator.h> #include <crepe/api/GameObject.h> @@ -9,14 +10,6 @@ using namespace crepe; using namespace std; -class PlayerScript : public Script { -public: - void update() { - Rigidbody & rb = this->get_components_by_name<Rigidbody>("player").front(); - if (this->get_key_state(Keycode::SPACE)) rb.add_force_linear(vec2(0, -10)); - } -}; - PlayerSubScene::PlayerSubScene(Scene & scn) { GameObject player = scn.new_object("player", "player", vec2(-100, 200)); Asset player_body_asset{"asset/jetpack_joyride/barry/defaultBody.png"}; |