aboutsummaryrefslogtreecommitdiff
path: root/game/coins/CoinSystemScript.h
blob: 6cf613a294c57a0b990e6d5699d65480e650d03e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#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 frame_update(crepe::duration_t dt) override;
private:
	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;
};