From 07615060da6c211e08a3d7f2e1bb9e99ffc05364 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Mon, 6 Jan 2025 17:49:39 +0100 Subject: moved and updated files --- game/coins/CoinData.h | 11 ----------- game/coins/CoinScript.cpp | 1 - game/coins/CoinSystemScript.cpp | 2 +- game/coins/CoinSystemScript.h | 10 +++++++++- 4 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 game/coins/CoinData.h (limited to 'game/coins') 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 - -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().active = false; this->get_component().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 CoinSystemScript::coin_locations; +std::vector 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 #include "api/CircleCollider.h" #include "api/Script.h" #include "api/Sprite.h" @@ -8,6 +9,13 @@ #include 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; -- cgit v1.2.3