aboutsummaryrefslogtreecommitdiff
path: root/game/missile/AlertSubScene.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-10 12:05:16 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-10 12:05:16 +0100
commit15a958a7f327bb2e81e7d445f1499ec78c7f5839 (patch)
tree335754f27b42f00353be643c2f01240ec7a2bcc4 /game/missile/AlertSubScene.cpp
parentd20b25828b53af170a6534263e8de114e7fac121 (diff)
alers scripts and quitscript with ESC key
Diffstat (limited to 'game/missile/AlertSubScene.cpp')
-rw-r--r--game/missile/AlertSubScene.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/game/missile/AlertSubScene.cpp b/game/missile/AlertSubScene.cpp
new file mode 100644
index 0000000..c3379e8
--- /dev/null
+++ b/game/missile/AlertSubScene.cpp
@@ -0,0 +1,38 @@
+#include "AlertSubScene.h"
+#include "../Config.h"
+#include "api/Animator.h"
+#include "api/BehaviorScript.h"
+#include "api/Scene.h"
+#include "api/Sprite.h"
+#include "missile/AlertScript.h"
+
+using namespace crepe;
+
+MissileAlert::MissileAlert(Scene& scn){
+ GameObject alert = scn.new_object("missile_alert", "missile_alert", {0, 0}, 0, 1);
+
+ Asset missile_alert_ss {"asset/obstacles/missile/missileAlert.png"};
+
+ //alert.add_component<BehaviorScript>().set_script<AlertScript>();
+
+ auto & missile_alert_sprite = alert.add_component<Sprite>(
+ missile_alert_ss,
+ Sprite::Data {
+ .sorting_in_layer = SORT_IN_LAY_OBSTACLES,
+ .size = {0, 100},
+ }
+ );
+
+ auto & missile_alert_anim = alert.add_component<Animator>(
+ missile_alert_sprite, ivec2 {64, 64}, uvec2 {4, 2},
+ Animator::Data {
+ .fps = 15,
+ .looping = true,
+ }
+ );
+
+ missile_alert_anim.set_anim(1);
+ missile_alert_sprite.active = false;
+
+
+}