aboutsummaryrefslogtreecommitdiff
path: root/game/coins
diff options
context:
space:
mode:
Diffstat (limited to 'game/coins')
-rw-r--r--game/coins/CoinScript.cpp5
-rw-r--r--game/coins/CoinScript.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/game/coins/CoinScript.cpp b/game/coins/CoinScript.cpp
index 862e7f9..5a1e922 100644
--- a/game/coins/CoinScript.cpp
+++ b/game/coins/CoinScript.cpp
@@ -2,6 +2,7 @@
#include "api/CircleCollider.h"
#include "api/Sprite.h"
#include "manager/SaveManager.h"
+#include "../Config.h"
using namespace crepe;
using namespace std;
@@ -12,8 +13,8 @@ bool CoinScript::on_collision(const CollisionEvent & collisionData){
this->get_component<Sprite>().active = false;
this->get_component<CircleCollider>().active = false;
SaveManager & savemgr = this->get_save_manager();
- int amount = savemgr.get<int>(COIN_GAME_AMOUNT,0).get() + 1;
- savemgr.set(COIN_GAME_AMOUNT, amount);
+ int amount = savemgr.get<int>(TOTAL_COINS_RUN,0).get() + 1;
+ savemgr.set(TOTAL_COINS_RUN, amount);
return true;
}
diff --git a/game/coins/CoinScript.h b/game/coins/CoinScript.h
index 3fcee6d..96e54fa 100644
--- a/game/coins/CoinScript.h
+++ b/game/coins/CoinScript.h
@@ -6,6 +6,4 @@ class CoinScript : public crepe::Script {
public:
void init() override;
bool on_collision(const crepe::CollisionEvent & collisionData);
- static constexpr const char* PLAYER_NAME = "player";
- static constexpr const char* COIN_GAME_AMOUNT = "coin_game_amount";
};