diff options
Diffstat (limited to 'game/GameScene.cpp')
-rw-r--r-- | game/GameScene.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/game/GameScene.cpp b/game/GameScene.cpp index a8fcb47..bd12d50 100644 --- a/game/GameScene.cpp +++ b/game/GameScene.cpp @@ -2,8 +2,14 @@ #include "Config.h" #include "MoveCameraManualyScript.h" #include "StartGameScript.h" +#include "coins/CoinSubScene.h" +#include "coins/CoinPool.h" +#include "coins/CoinSystemScript.h" #include "background/BackgroundSubScene.h" +#include "hud/HudScript.h" +#include "hud/HudSubScene.h" +#include "hud/SpeedScript.h" #include "player/PlayerSubScene.h" #include <cmath> @@ -36,7 +42,11 @@ void GameScene::load_scene() { } ); camera.add_component<BehaviorScript>().set_script<MoveCameraManualyScript>(); - camera.add_component<Rigidbody>(Rigidbody::Data {}); + camera.add_component<BehaviorScript>().set_script<CoinSystemScript>(); + camera.add_component<BehaviorScript>().set_script<HudScript>(); + camera.add_component<BehaviorScript>().set_script<SpeedScript>(); + + camera.add_component<Rigidbody>(Rigidbody::Data{}); PlayerSubScene player(*this); @@ -67,6 +77,13 @@ void GameScene::load_scene() { GameObject start_game_script = new_object("start_game_script", "script", vec2(0, 0)); start_game_script.add_component<BehaviorScript>().set_script<StartGameScript>(); + //create coin pool + CoinPool coin_system; + coin_system.create_coins(*this); + + HudSubScene hud; + hud.create(*this); + // zapper, laser and missile (below) for testing purpose only!!! GameObject zapper = new_object("zapper", "zapper", vec2(1000, 0)); Asset zapper_asset {"asset/obstacles/zapper/regular_zappers/zapEffect.png"}; |