diff options
Diffstat (limited to 'game')
-rw-r--r-- | game/CMakeLists.txt | 12 | ||||
-rw-r--r-- | game/GameScene.cpp | 6 | ||||
-rw-r--r-- | game/coins/CoinPoolSubScene.cpp (renamed from game/coins/CoinPool.cpp) | 4 | ||||
-rw-r--r-- | game/coins/CoinPoolSubScene.h (renamed from game/coins/CoinPool.h) | 2 | ||||
-rw-r--r-- | game/menus/ButtonNextMainMenuSubScript.cpp (renamed from game/menus/ButtonNextMainMenuScript.cpp) | 6 | ||||
-rw-r--r-- | game/menus/ButtonNextMainMenuSubScript.h (renamed from game/menus/ButtonNextMainMenuScript.h) | 2 | ||||
-rw-r--r-- | game/menus/ButtonSetMainMenuSubScript.cpp (renamed from game/menus/ButtonSetMainMenuScript.cpp) | 6 | ||||
-rw-r--r-- | game/menus/ButtonSetMainMenuSubScript.h (renamed from game/menus/ButtonSetMainMenuScript.h) | 2 | ||||
-rw-r--r-- | game/menus/ButtonSetShopSubScript.cpp (renamed from game/menus/ButtonSetShopScript.cpp) | 6 | ||||
-rw-r--r-- | game/menus/ButtonSetShopSubScript.h (renamed from game/menus/ButtonSetShopScript.h) | 2 | ||||
-rw-r--r-- | game/menus/ButtonSubScene.cpp | 16 | ||||
-rw-r--r-- | game/menus/mainmenu/ButtonTransitionPreviewSubScript.cpp (renamed from game/menus/mainmenu/ButtonTransitionPreviewScript.cpp) | 8 | ||||
-rw-r--r-- | game/menus/mainmenu/ButtonTransitionPreviewSubScript.h (renamed from game/menus/mainmenu/ButtonTransitionPreviewScript.h) | 2 | ||||
-rw-r--r-- | game/menus/mainmenu/MainMenuScene.cpp | 4 | ||||
-rw-r--r-- | game/menus/mainmenu/TransitionStartSubScript.cpp (renamed from game/menus/mainmenu/TransitionStartScript.cpp) | 6 | ||||
-rw-r--r-- | game/menus/mainmenu/TransitionStartSubScript.h (renamed from game/menus/mainmenu/TransitionStartScript.h) | 2 |
16 files changed, 42 insertions, 44 deletions
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index ccafc9b..de10433 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -26,20 +26,20 @@ add_executable(main menus/BannerSubScene.cpp menus/ButtonSubScene.cpp menus/IButtonScript.cpp - menus/ButtonSetShopScript.cpp - menus/ButtonSetMainMenuScript.cpp - menus/ButtonNextMainMenuScript.cpp + menus/ButtonSetShopSubScript.cpp + menus/ButtonSetMainMenuSubScript.cpp + menus/ButtonNextMainMenuSubScript.cpp menus/FloatingWindowSubScene.cpp menus/IFloatingWindowScript.cpp menus/shop/ShopMenuScene.cpp - menus/mainmenu/ButtonTransitionPreviewScript.cpp + menus/mainmenu/ButtonTransitionPreviewSubScript.cpp menus/mainmenu/ITransitionScript.cpp menus/mainmenu/MainMenuScene.cpp - menus/mainmenu/TransitionStartScript.cpp + menus/mainmenu/TransitionStartSubScript.cpp menus/endgame/EndGameSubScene.cpp menus/endgame/EndGameSubScript.cpp coins/CoinSubScene.cpp - coins/CoinPool.cpp + coins/CoinPoolSubScene.cpp coins/CoinSystemScript.cpp coins/CoinScript.cpp hud/HudSubScene.cpp diff --git a/game/GameScene.cpp b/game/GameScene.cpp index fce8206..38ac4b1 100644 --- a/game/GameScene.cpp +++ b/game/GameScene.cpp @@ -2,8 +2,7 @@ #include "Config.h" #include "MoveCameraManualyScript.h" #include "StartGameScript.h" -#include "coins/CoinSubScene.h" -#include "coins/CoinPool.h" +#include "coins/CoinPoolSubScene.h" #include "coins/CoinSystemScript.h" #include "background/BackgroundSubScene.h" @@ -11,7 +10,6 @@ #include "hud/HudSubScene.h" #include "hud/SpeedScript.h" #include "menus/endgame/EndGameSubScene.h" -#include "menus/endgame/EndGameSubScript.h" #include "player/PlayerSubScene.h" #include <cmath> @@ -81,7 +79,7 @@ void GameScene::load_scene() { start_game_script.add_component<BehaviorScript>().set_script<StartGameScript>(); //create coin pool - CoinPool coin_system; + CoinPoolSubScene coin_system; coin_system.create_coins(*this); HudSubScene hud; diff --git a/game/coins/CoinPool.cpp b/game/coins/CoinPoolSubScene.cpp index 1d2d0de..05f6bfc 100644 --- a/game/coins/CoinPool.cpp +++ b/game/coins/CoinPoolSubScene.cpp @@ -1,10 +1,10 @@ -#include "CoinPool.h" +#include "CoinPoolSubScene.h" #include "CoinSubScene.h" using namespace crepe; using namespace std; -void CoinPool::create_coins(crepe::Scene & scn) { +void CoinPoolSubScene::create_coins(crepe::Scene & scn) { int amount = 0; CoinSubScene coin; while(amount < this->MAXIMUM_AMOUNT){ diff --git a/game/coins/CoinPool.h b/game/coins/CoinPoolSubScene.h index d94c352..7360051 100644 --- a/game/coins/CoinPool.h +++ b/game/coins/CoinPoolSubScene.h @@ -2,7 +2,7 @@ #include <crepe/api/Scene.h> -class CoinPool { +class CoinPoolSubScene { public: void create_coins(crepe::Scene & scn); private: diff --git a/game/menus/ButtonNextMainMenuScript.cpp b/game/menus/ButtonNextMainMenuSubScript.cpp index 7ebb2cf..d6e315e 100644 --- a/game/menus/ButtonNextMainMenuScript.cpp +++ b/game/menus/ButtonNextMainMenuSubScript.cpp @@ -1,4 +1,4 @@ -#include "ButtonNextMainMenuScript.h" +#include "ButtonNextMainMenuSubScript.h" #include "MenusConfig.h" #include "ValueBroker.h" @@ -12,12 +12,12 @@ using namespace crepe; using namespace std; -void ButtonNextMainMenuScript::init(){ +void ButtonNextMainMenuSubScript::init(){ IButtonScript::init(); this->subscribe<ButtonPressEvent>([this](const ButtonPressEvent& e) { return this->on_button_press(e); }); } -bool ButtonNextMainMenuScript::on_button_press(const ButtonPressEvent& e){ +bool ButtonNextMainMenuSubScript::on_button_press(const ButtonPressEvent& e){ RefVector<AudioSource> audios = this->get_components_by_name<AudioSource>("background_music"); for (AudioSource & audio : audios) { diff --git a/game/menus/ButtonNextMainMenuScript.h b/game/menus/ButtonNextMainMenuSubScript.h index b9f70b3..cb5c8ca 100644 --- a/game/menus/ButtonNextMainMenuScript.h +++ b/game/menus/ButtonNextMainMenuSubScript.h @@ -4,7 +4,7 @@ #include <crepe/api/Script.h> -class ButtonNextMainMenuScript : public IButtonScript { +class ButtonNextMainMenuSubScript : public IButtonScript { public: void init() override; bool on_button_press(const crepe::ButtonPressEvent& e); diff --git a/game/menus/ButtonSetMainMenuScript.cpp b/game/menus/ButtonSetMainMenuSubScript.cpp index 1e4179c..2181f44 100644 --- a/game/menus/ButtonSetMainMenuScript.cpp +++ b/game/menus/ButtonSetMainMenuSubScript.cpp @@ -1,4 +1,4 @@ -#include "ButtonSetMainMenuScript.h" +#include "ButtonSetMainMenuSubScript.h" #include "MenusConfig.h" #include <crepe/api/AudioSource.h> @@ -7,12 +7,12 @@ using namespace crepe; using namespace std; -void ButtonSetMainMenuScript::init(){ +void ButtonSetMainMenuSubScript::init(){ IButtonScript::init(); this->subscribe<ButtonPressEvent>([this](const ButtonPressEvent& e) { return this->on_button_press(e); }); } -bool ButtonSetMainMenuScript::on_button_press(const ButtonPressEvent& e){ +bool ButtonSetMainMenuSubScript::on_button_press(const ButtonPressEvent& e){ RefVector<AudioSource> audios = this->get_components_by_name<AudioSource>("background_music"); this->set_next_scene(MAINMENU_SCENE); diff --git a/game/menus/ButtonSetMainMenuScript.h b/game/menus/ButtonSetMainMenuSubScript.h index 13a33bf..40e2c11 100644 --- a/game/menus/ButtonSetMainMenuScript.h +++ b/game/menus/ButtonSetMainMenuSubScript.h @@ -4,7 +4,7 @@ #include <crepe/api/Script.h> -class ButtonSetMainMenuScript : public IButtonScript { +class ButtonSetMainMenuSubScript : public IButtonScript { public: void init() override; bool on_button_press(const crepe::ButtonPressEvent& e); diff --git a/game/menus/ButtonSetShopScript.cpp b/game/menus/ButtonSetShopSubScript.cpp index 88639bd..67005a7 100644 --- a/game/menus/ButtonSetShopScript.cpp +++ b/game/menus/ButtonSetShopSubScript.cpp @@ -1,15 +1,15 @@ -#include "ButtonSetShopScript.h" +#include "ButtonSetShopSubScript.h" #include "MenusConfig.h" using namespace crepe; using namespace std; -void ButtonSetShopScript::init(){ +void ButtonSetShopSubScript::init(){ IButtonScript::init(); this->subscribe<ButtonPressEvent>([this](const ButtonPressEvent& e) { return this->on_button_press(e); }); } -bool ButtonSetShopScript::on_button_press(const ButtonPressEvent& e){ +bool ButtonSetShopSubScript::on_button_press(const ButtonPressEvent& e){ this->set_next_scene(SHOP_SCENE); return false; } diff --git a/game/menus/ButtonSetShopScript.h b/game/menus/ButtonSetShopSubScript.h index 434abc0..8edc7bf 100644 --- a/game/menus/ButtonSetShopScript.h +++ b/game/menus/ButtonSetShopSubScript.h @@ -4,7 +4,7 @@ #include <crepe/api/Script.h> -class ButtonSetShopScript : public IButtonScript { +class ButtonSetShopSubScript : public IButtonScript { public: void init() override; bool on_button_press(const crepe::ButtonPressEvent& e); diff --git a/game/menus/ButtonSubScene.cpp b/game/menus/ButtonSubScene.cpp index ea0df8a..5f7f2b0 100644 --- a/game/menus/ButtonSubScene.cpp +++ b/game/menus/ButtonSubScene.cpp @@ -1,11 +1,11 @@ #include "ButtonSubScene.h" -#include "ButtonNextMainMenuScript.h" -#include "ButtonSetMainMenuScript.h" -#include "ButtonSetShopScript.h" +#include "ButtonNextMainMenuSubScript.h" +#include "ButtonSetMainMenuSubScript.h" +#include "ButtonSetShopSubScript.h" #include "IButtonScript.h" #include "MenusConfig.h" -#include "mainmenu/ButtonTransitionPreviewScript.h" +#include "mainmenu/ButtonTransitionPreviewSubScript.h" #include "../Config.h" @@ -39,16 +39,16 @@ void ButtonSubScene::btn_text(crepe::GameObject & button_object,const Data & dat void ButtonSubScene::set_script(crepe::GameObject & button_object,const Data & data){ switch (data.script_type) { case ScriptSelect::PREVIEW: - button_object.add_component<BehaviorScript>().set_script<ButtonTransitionPreviewScript>(); + button_object.add_component<BehaviorScript>().set_script<ButtonTransitionPreviewSubScript>(); break; case ScriptSelect::SHOP: - button_object.add_component<BehaviorScript>().set_script<ButtonSetShopScript>(); + button_object.add_component<BehaviorScript>().set_script<ButtonSetShopSubScript>(); break; case ScriptSelect::MAINMENU: - button_object.add_component<BehaviorScript>().set_script<ButtonSetMainMenuScript>(); + button_object.add_component<BehaviorScript>().set_script<ButtonSetMainMenuSubScript>(); break; case ScriptSelect::NEXT: - button_object.add_component<BehaviorScript>().set_script<ButtonNextMainMenuScript>(); + button_object.add_component<BehaviorScript>().set_script<ButtonNextMainMenuSubScript>(); break; case ScriptSelect::NONE: button_object.add_component<BehaviorScript>().set_script<IButtonScript>(); diff --git a/game/menus/mainmenu/ButtonTransitionPreviewScript.cpp b/game/menus/mainmenu/ButtonTransitionPreviewSubScript.cpp index 084d02b..8c055ec 100644 --- a/game/menus/mainmenu/ButtonTransitionPreviewScript.cpp +++ b/game/menus/mainmenu/ButtonTransitionPreviewSubScript.cpp @@ -1,21 +1,21 @@ -#include "ButtonTransitionPreviewScript.h" +#include "ButtonTransitionPreviewSubScript.h" #include "../MenusConfig.h" using namespace crepe; using namespace std; -void ButtonTransitionPreviewScript::init(){ +void ButtonTransitionPreviewSubScript::init(){ IButtonScript::init(); this->subscribe<ButtonPressEvent>([this](const ButtonPressEvent& e) { return this->on_button_press(e); }); } -bool ButtonTransitionPreviewScript::on_button_press(const ButtonPressEvent& e){ +bool ButtonTransitionPreviewSubScript::on_button_press(const ButtonPressEvent& e){ if(!this->transition) this->transition = true; return false; } -const char* ButtonTransitionPreviewScript::get_scene_name() const { +const char* ButtonTransitionPreviewSubScript::get_scene_name() const { // Provide the next scene defined in MainMenuConfig return PREVIEW_SCENE; } diff --git a/game/menus/mainmenu/ButtonTransitionPreviewScript.h b/game/menus/mainmenu/ButtonTransitionPreviewSubScript.h index 5973dbf..6e6b0b2 100644 --- a/game/menus/mainmenu/ButtonTransitionPreviewScript.h +++ b/game/menus/mainmenu/ButtonTransitionPreviewSubScript.h @@ -4,7 +4,7 @@ #include "../IButtonScript.h" -class ButtonTransitionPreviewScript : public ITransitionScript, public IButtonScript { +class ButtonTransitionPreviewSubScript : public ITransitionScript, public IButtonScript { public: void init() override; bool on_button_press(const crepe::ButtonPressEvent& e); diff --git a/game/menus/mainmenu/MainMenuScene.cpp b/game/menus/mainmenu/MainMenuScene.cpp index 15cf6d5..e0dfbee 100644 --- a/game/menus/mainmenu/MainMenuScene.cpp +++ b/game/menus/mainmenu/MainMenuScene.cpp @@ -1,6 +1,6 @@ #include "MainMenuScene.h" -#include "TransitionStartScript.h" +#include "TransitionStartSubScript.h" #include "MainMenuConfig.h" #include "../ButtonSubScene.h" @@ -29,7 +29,7 @@ void MainMenuScene::load_scene(){ Camera::Data{ .bg_color = Color::RED, }); - camera_object.add_component<BehaviorScript>().set_script<TransitionStartScript>(); + camera_object.add_component<BehaviorScript>().set_script<TransitionStartSubScript>(); //Button menu diff --git a/game/menus/mainmenu/TransitionStartScript.cpp b/game/menus/mainmenu/TransitionStartSubScript.cpp index 9b395de..6ad4673 100644 --- a/game/menus/mainmenu/TransitionStartScript.cpp +++ b/game/menus/mainmenu/TransitionStartSubScript.cpp @@ -1,15 +1,15 @@ -#include "TransitionStartScript.h" +#include "TransitionStartSubScript.h" #include "../MenusConfig.h" using namespace crepe; using namespace std; -void TransitionStartScript::fixed_update(crepe::duration_t dt){ +void TransitionStartSubScript::fixed_update(crepe::duration_t dt){ if(this->get_key_state(Keycode::ENTER) && this->transition == false) this->transition = true; } -const char* TransitionStartScript::get_scene_name() const { +const char* TransitionStartSubScript::get_scene_name() const { // Provide the next scene defined in MainMenuConfig return START_SCENE; } diff --git a/game/menus/mainmenu/TransitionStartScript.h b/game/menus/mainmenu/TransitionStartSubScript.h index c6df1b9..b41360d 100644 --- a/game/menus/mainmenu/TransitionStartScript.h +++ b/game/menus/mainmenu/TransitionStartSubScript.h @@ -2,7 +2,7 @@ #include "ITransitionScript.h" -class TransitionStartScript : public ITransitionScript { +class TransitionStartSubScript : public ITransitionScript { public: void fixed_update(crepe::duration_t dt) override; const char* get_scene_name() const override; |