diff options
Diffstat (limited to 'game/coins/CoinScript.cpp')
-rw-r--r-- | game/coins/CoinScript.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/game/coins/CoinScript.cpp b/game/coins/CoinScript.cpp index f067f04..862e7f9 100644 --- a/game/coins/CoinScript.cpp +++ b/game/coins/CoinScript.cpp @@ -1,6 +1,7 @@ #include "CoinScript.h" #include "api/CircleCollider.h" #include "api/Sprite.h" +#include "manager/SaveManager.h" using namespace crepe; using namespace std; @@ -10,6 +11,9 @@ bool CoinScript::on_collision(const CollisionEvent & collisionData){ //collide with player 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); return true; } |