aboutsummaryrefslogtreecommitdiff
path: root/game/enemy/BattleScript.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2025-01-11 21:32:30 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2025-01-11 21:32:30 +0100
commita6803980f1e74ecf1abb007b7c77f00d2cd92c43 (patch)
tree425ca961b27117d6e5d5fa0ae5cfca93351e0b33 /game/enemy/BattleScript.h
parent6bc0025e4c24ed6659d993f3469c10615fb0e273 (diff)
parent525636bb2158ecea68ebb9d6b8d2dc722524c5e5 (diff)
merge master into loek/doxygen
Diffstat (limited to 'game/enemy/BattleScript.h')
-rw-r--r--game/enemy/BattleScript.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/game/enemy/BattleScript.h b/game/enemy/BattleScript.h
new file mode 100644
index 0000000..57aa16c
--- /dev/null
+++ b/game/enemy/BattleScript.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <crepe/api/BehaviorScript.h>
+#include <crepe/api/Event.h>
+#include <crepe/api/Script.h>
+#include <random>
+struct BattleWonEvent : public crepe::Event {};
+
+struct BattleStartEvent : public crepe::Event {
+public:
+ int num_enemies = 0;
+ bool battle = false;
+};
+class BattleScript : public crepe::Script {
+public:
+ BattleScript();
+ void init() override;
+ void fixed_update(crepe::duration_t dt) override;
+
+private:
+ bool battle_active = false;
+ std::random_device rd;
+ std::default_random_engine engine;
+ void spawn_enemies(int amount);
+ bool create_battle(const BattleStartEvent & e);
+};