aboutsummaryrefslogtreecommitdiff
path: root/game/coins/CoinSystemScript.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-28 19:33:06 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-28 19:33:06 +0100
commitfb096afbdf3d24f5b9f31626ddf8581033346f88 (patch)
tree1cb4e653322784fc28d87e0458c63d1e3d199f20 /game/coins/CoinSystemScript.h
parent26d66b7a73ac8d172d342be03bd75bd5bea221e1 (diff)
coins with system pooling
Diffstat (limited to 'game/coins/CoinSystemScript.h')
-rw-r--r--game/coins/CoinSystemScript.h16
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;
};