diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-11 21:32:30 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-11 21:32:30 +0100 |
commit | a6803980f1e74ecf1abb007b7c77f00d2cd92c43 (patch) | |
tree | 425ca961b27117d6e5d5fa0ae5cfca93351e0b33 /game/prefab/ZapperPoolScript.h | |
parent | 6bc0025e4c24ed6659d993f3469c10615fb0e273 (diff) | |
parent | 525636bb2158ecea68ebb9d6b8d2dc722524c5e5 (diff) |
merge master into loek/doxygen
Diffstat (limited to 'game/prefab/ZapperPoolScript.h')
-rw-r--r-- | game/prefab/ZapperPoolScript.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/game/prefab/ZapperPoolScript.h b/game/prefab/ZapperPoolScript.h new file mode 100644 index 0000000..2208c80 --- /dev/null +++ b/game/prefab/ZapperPoolScript.h @@ -0,0 +1,33 @@ +#pragma once + +#include <crepe/api/Script.h> + +#include "ZapperObject.h" +#include "util/OptionalRef.h" + +class ZapperPoolSubScene; + +class ZapperPoolScript : public crepe::Script { +public: + ZapperPoolScript(std::vector<ZapperObject> && pool); + + void init(); + void fixed_update(crepe::duration_t); + + unsigned i = 0; + +private: + std::vector<ZapperObject> pool; + +private: + crepe::OptionalRef<crepe::Transform> camera_transform; + crepe::OptionalRef<crepe::Camera> camera_camera; + crepe::OptionalRef<ZapperObject> get_next_zapper(); + +private: + void spawn_random(); + +private: + static constexpr float MAX_LENGTH = 400; + static constexpr float OFFSCREEN_MARGIN = 50 + MAX_LENGTH; +}; |