aboutsummaryrefslogtreecommitdiff
path: root/game/coins
diff options
context:
space:
mode:
Diffstat (limited to 'game/coins')
-rw-r--r--game/coins/CoinData.h11
-rw-r--r--game/coins/CoinScript.cpp1
-rw-r--r--game/coins/CoinSystemScript.cpp2
-rw-r--r--game/coins/CoinSystemScript.h10
4 files changed, 10 insertions, 14 deletions
diff --git a/game/coins/CoinData.h b/game/coins/CoinData.h
deleted file mode 100644
index 09b3448..0000000
--- a/game/coins/CoinData.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#pragma once
-
-#include "types.h"
-#include <string>
-
-struct CoinData{
- crepe::vec2 start_location = {0,0};
- std::string name = "";
- bool active = false;
- CoinData(crepe::vec2 start_location) : start_location(start_location),name(""), active(false) {}
-};
diff --git a/game/coins/CoinScript.cpp b/game/coins/CoinScript.cpp
index 5a1e922..e40f658 100644
--- a/game/coins/CoinScript.cpp
+++ b/game/coins/CoinScript.cpp
@@ -9,7 +9,6 @@ using namespace std;
bool CoinScript::on_collision(const CollisionEvent & collisionData){
if(collisionData.info.other.metadata.name != PLAYER_NAME) return true;
- //collide with player
this->get_component<Sprite>().active = false;
this->get_component<CircleCollider>().active = false;
SaveManager & savemgr = this->get_save_manager();
diff --git a/game/coins/CoinSystemScript.cpp b/game/coins/CoinSystemScript.cpp
index 41b1d3d..b77c597 100644
--- a/game/coins/CoinSystemScript.cpp
+++ b/game/coins/CoinSystemScript.cpp
@@ -10,7 +10,7 @@
using namespace crepe;
using namespace std;
-std::vector<CoinData> CoinSystemScript::coin_locations;
+std::vector<CoinSystemScript::CoinData> CoinSystemScript::coin_locations;
void CoinSystemScript::init() {
engine.seed(rd());
diff --git a/game/coins/CoinSystemScript.h b/game/coins/CoinSystemScript.h
index 4bafa01..f558f08 100644
--- a/game/coins/CoinSystemScript.h
+++ b/game/coins/CoinSystemScript.h
@@ -1,6 +1,7 @@
#pragma once
-#include "CoinData.h"
+#include "types.h"
+#include <string>
#include "api/CircleCollider.h"
#include "api/Script.h"
#include "api/Sprite.h"
@@ -8,6 +9,13 @@
#include <random>
class CoinSystemScript : public crepe::Script {
+private:
+ struct CoinData{
+ crepe::vec2 start_location = {0,0};
+ std::string name = "";
+ bool active = false;
+ CoinData(crepe::vec2 start_location) : start_location(start_location),name(""), active(false) {}
+ };
public:
CoinSystemScript() {};
void init() override;