aboutsummaryrefslogtreecommitdiff
path: root/game/prefab/ZapperObject.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-08 18:40:11 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-08 18:40:11 +0100
commitef3f5b0845ba127c0bfcda8c2fce37013fef3878 (patch)
treee5690ff875a662ee7603844e858d82428d973a78 /game/prefab/ZapperObject.h
parent424da5eb1500d90389d939cd0b3e6e75d729578d (diff)
parent2ad15f3efab481659543a1c03cd70a36fd297538 (diff)
Merge branch 'master' of github.com:lonkaars/crepe into jaro/game
Diffstat (limited to 'game/prefab/ZapperObject.h')
-rw-r--r--game/prefab/ZapperObject.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/game/prefab/ZapperObject.h b/game/prefab/ZapperObject.h
new file mode 100644
index 0000000..42edc51
--- /dev/null
+++ b/game/prefab/ZapperObject.h
@@ -0,0 +1,40 @@
+#pragma once
+
+#include <crepe/api/Animator.h>
+#include <crepe/api/BoxCollider.h>
+#include <crepe/api/GameObject.h>
+#include <crepe/api/Rigidbody.h>
+#include <crepe/api/Sprite.h>
+
+class ZapperObject : public crepe::GameObject {
+public:
+ ZapperObject(crepe::GameObject &&);
+
+public:
+ bool active = true;
+
+ struct {
+ crepe::Sprite & orb_start;
+ crepe::Sprite & orb_end;
+ crepe::Sprite & glow_start;
+ crepe::Sprite & glow_end;
+ crepe::Sprite & beam;
+ } sprite;
+
+ struct {
+ crepe::Animator & orb_start;
+ crepe::Animator & orb_end;
+ crepe::Animator & glow_start;
+ crepe::Animator & glow_end;
+ } animator;
+
+ crepe::Rigidbody & body;
+ crepe::BoxCollider & collider;
+
+private:
+ static constexpr float SCALE = 0.8;
+
+public:
+ void place(const crepe::vec2 & position, float rotation, float length);
+ void set_active(bool active);
+};