diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-28 19:33:06 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-28 19:33:06 +0100 |
commit | fb096afbdf3d24f5b9f31626ddf8581033346f88 (patch) | |
tree | 1cb4e653322784fc28d87e0458c63d1e3d199f20 /game/coins/CoinSystemScript.h | |
parent | 26d66b7a73ac8d172d342be03bd75bd5bea221e1 (diff) |
coins with system pooling
Diffstat (limited to 'game/coins/CoinSystemScript.h')
-rw-r--r-- | game/coins/CoinSystemScript.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/game/coins/CoinSystemScript.h b/game/coins/CoinSystemScript.h index 96744f1..6cf613a 100644 --- a/game/coins/CoinSystemScript.h +++ b/game/coins/CoinSystemScript.h @@ -1,13 +1,23 @@ #pragma once -#include "CoinSystem.h" +#include "CoinData.h" +#include "api/CircleCollider.h" #include "api/Script.h" +#include "api/Sprite.h" +#include "api/Transform.h" class CoinSystemScript : public crepe::Script { public: CoinSystemScript() {}; - // void init() override; + void init() override; void frame_update(crepe::duration_t dt) override; private: - CoinSystem coin_system; + void add_location(const crepe::vec2& location); + void despawn_coins(); + void spawn_coins(); +private: + static constexpr float SPAWN_DISTANCE = 400; + static constexpr float DESPAWN_DISTANCE = 400; + static constexpr float SPAWN_AREA = 50; + static std::vector<CoinData> coin_locations; }; |