aboutsummaryrefslogtreecommitdiff
path: root/game/coins/CoinSystemScript.cpp
blob: 90405a81bf3ca7fbd3f01bec421fa48ad58b040a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);	
}