aboutsummaryrefslogtreecommitdiff
path: root/game/enemy/BattleScript.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 10:08:03 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 10:08:03 +0100
commit7f7c5c56dce30d47c32fb57fad6d839d0990b054 (patch)
treeeebc8d3f4c332d969f4a66a566edd844bd43387c /game/enemy/BattleScript.h
parentceb41b7ae7e2734af954364b319fc0b6f2a86c2f (diff)
enemy spawn working + enemy shooting
Diffstat (limited to 'game/enemy/BattleScript.h')
-rw-r--r--game/enemy/BattleScript.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/game/enemy/BattleScript.h b/game/enemy/BattleScript.h
new file mode 100644
index 0000000..d239e70
--- /dev/null
+++ b/game/enemy/BattleScript.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <crepe/api/Script.h>
+#include <crepe/api/BehaviorScript.h>
+#include <crepe/api/Event.h>
+#include <random>
+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:
+ std::random_device rd;
+ std::default_random_engine engine;
+ bool create_battle(const BattleStartEvent& e);
+};