aboutsummaryrefslogtreecommitdiff
path: root/game/coins/CoinSystemScript.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-28 16:22:58 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-28 16:22:58 +0100
commit26d66b7a73ac8d172d342be03bd75bd5bea221e1 (patch)
tree8814afa7859bf7d142b475acec4432e254e204c8 /game/coins/CoinSystemScript.cpp
parent6a3063e6012bae44457b668ce48c48b8af90a95d (diff)
coin system
Diffstat (limited to 'game/coins/CoinSystemScript.cpp')
-rw-r--r--game/coins/CoinSystemScript.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/game/coins/CoinSystemScript.cpp b/game/coins/CoinSystemScript.cpp
new file mode 100644
index 0000000..90405a8
--- /dev/null
+++ b/game/coins/CoinSystemScript.cpp
@@ -0,0 +1,18 @@
+#include "CoinSystemScript.h"
+#include "CoinSystem.h"
+#include "api/CircleCollider.h"
+#include "api/Metadata.h"
+#include "api/Transform.h"
+
+using namespace crepe;
+using namespace std;
+
+void CoinSystemScript::frame_update(crepe::duration_t dt)
+{
+ float position = this->get_component<Transform>().position.x;
+ RefVector<Sprite> coin_sprites = this->get_components_by_tag<Sprite>("coin");
+ RefVector<CircleCollider> coin_colliders = this->get_components_by_tag<CircleCollider>("coin");
+ RefVector<Metadata> coin_metadatas = this->get_components_by_tag<Metadata>("coin");
+ this->coin_system.update(position, coin_sprites, coin_colliders, coin_metadatas);
+}
+