diff options
author | heavydemon21 <48092678+heavydemon21@users.noreply.github.com> | 2025-01-10 20:08:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 20:08:37 +0100 |
commit | ba0db2e49ff1b5c3e952c00bbc3f31176397f6b6 (patch) | |
tree | eefa561b81c48549277950692fdad714a2f501f2 /game/preview/PrevPlayerScript.cpp | |
parent | b9d00961a8894356c7cff7597de424a12d2841a6 (diff) | |
parent | 16917357837916d1ef88b6122218fa0d567d1ddc (diff) |
Merge pull request #131 from lonkaars/niels/game
Niels/game
Diffstat (limited to 'game/preview/PrevPlayerScript.cpp')
-rw-r--r-- | game/preview/PrevPlayerScript.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/game/preview/PrevPlayerScript.cpp b/game/preview/PrevPlayerScript.cpp index 2657b8d..fce5c5a 100644 --- a/game/preview/PrevPlayerScript.cpp +++ b/game/preview/PrevPlayerScript.cpp @@ -1,12 +1,11 @@ #include "PrevPlayerScript.h" #include "../missile/SpawnEvent.h" -#include "api/Transform.h" + #include <crepe/api/AudioSource.h> #include <crepe/api/Camera.h> +#include <crepe/api/Transform.h> #include <crepe/manager/SaveManager.h> -#include <iostream> -#include <ostream> using namespace crepe; @@ -59,16 +58,16 @@ bool PrevPlayerScript::key_pressed(const KeyPressEvent & ev) { this->head_anim->set_anim(7); break; case Keycode::LEFT: - this->head->data.angle_offset -= 1; + this->get_component<Transform>().rotation += 10; break; case Keycode::RIGHT: - this->head->data.angle_offset += 1; + this->get_component<Transform>().rotation -= 10; break; case Keycode::UP: - this->head->data.scale_offset += 0.1; + this->head->data.position_offset += 10; break; case Keycode::DOWN: - this->head->data.scale_offset -= 0.1; + this->head->data.position_offset -= 10; break; case Keycode::P: this->get_component<AudioSource>().play(); @@ -98,11 +97,6 @@ bool PrevPlayerScript::key_pressed(const KeyPressEvent & ev) { case Keycode::M: trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); break; - //todo - case Keycode::PAGE_UP: - case Keycode::PAGE_DOWN: - case Keycode::HOME: - break; default: break; } |