aboutsummaryrefslogtreecommitdiff
path: root/game/enemy/BattleScript.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/enemy/BattleScript.h
parent424da5eb1500d90389d939cd0b3e6e75d729578d (diff)
parent2ad15f3efab481659543a1c03cd70a36fd297538 (diff)
Merge branch 'master' of github.com:lonkaars/crepe into jaro/game
Diffstat (limited to 'game/enemy/BattleScript.h')
-rw-r--r--game/enemy/BattleScript.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/game/enemy/BattleScript.h b/game/enemy/BattleScript.h
new file mode 100644
index 0000000..ddd0be1
--- /dev/null
+++ b/game/enemy/BattleScript.h
@@ -0,0 +1,24 @@
+#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;
+};
+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;
+ bool create_battle(const BattleStartEvent & e);
+};