aboutsummaryrefslogtreecommitdiff
path: root/game/GameScene.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-05 14:26:19 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-05 14:26:19 +0100
commitba170d00586ab261e015cc2febbb43f9aa7ae43e (patch)
tree4b902f20aa0b10a3ac04ec2c03f46ec3449558d1 /game/GameScene.cpp
parent5ae4e3f0e3ff1d111eaea54b7b0a0788203d9d72 (diff)
added hud
Diffstat (limited to 'game/GameScene.cpp')
-rw-r--r--game/GameScene.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/game/GameScene.cpp b/game/GameScene.cpp
index 551f4f1..2073a1e 100644
--- a/game/GameScene.cpp
+++ b/game/GameScene.cpp
@@ -8,6 +8,8 @@
#include "coins/CoinSystemScript.h"
#include "background/BackgroundSubScene.h"
+#include "hud/HudScript.h"
+#include "hud/HudSubScene.h"
#include <cmath>
#include <crepe/api/Animator.h>
@@ -40,6 +42,7 @@ void GameScene::load_scene() {
);
camera.add_component<BehaviorScript>().set_script<MoveCameraManualyScript>();
camera.add_component<BehaviorScript>().set_script<CoinSystemScript>();
+ camera.add_component<BehaviorScript>().set_script<HudScript>();
camera.add_component<Rigidbody>(Rigidbody::Data{});
PlayerSubScene player(*this);
@@ -71,12 +74,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>();
- CoinSubScene coin;
- coin.create(*this);
-
+ //create coin pool
CoinPool coin_system;
coin_system.create_coins(*this);
+ HudSubScene hud;
+ hud.create(*this);
+
}
string GameScene::get_name() const { return "scene1"; }