diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-08 11:13:40 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-08 11:13:40 +0100 |
commit | 06d41eb2d58de21a8340ca59952b96cabc8caee6 (patch) | |
tree | 4daa9f74cb8a088ba17e54d52be307c5b917878f /game/prefab/ZapperPoolScript.h | |
parent | b8acb539a3580bf0665fe435c55f33ba16cb507e (diff) |
pooling working
Diffstat (limited to 'game/prefab/ZapperPoolScript.h')
-rw-r--r-- | game/prefab/ZapperPoolScript.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/game/prefab/ZapperPoolScript.h b/game/prefab/ZapperPoolScript.h index 7c4701c..5daba79 100644 --- a/game/prefab/ZapperPoolScript.h +++ b/game/prefab/ZapperPoolScript.h @@ -2,11 +2,14 @@ #include <crepe/api/Script.h> +#include "ZapperObject.h" +#include "util/OptionalRef.h" + class ZapperPoolSubScene; class ZapperPoolScript : public crepe::Script { public: - ZapperPoolScript(ZapperPoolSubScene & pool); + ZapperPoolScript(std::vector<ZapperObject> && pool); void init(); void fixed_update(crepe::duration_t); @@ -14,10 +17,12 @@ public: unsigned i = 0; private: - ZapperPoolSubScene & pool; + std::vector<ZapperObject> pool; private: - crepe::vec2 get_camera_pos(); + crepe::OptionalRef<crepe::Transform> camera_transform; + crepe::OptionalRef<crepe::Camera> camera_camera; + crepe::OptionalRef<ZapperObject> get_next_zapper(); private: void spawn_random(); |