aboutsummaryrefslogtreecommitdiff
path: root/game/GameScene.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-22 16:12:31 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-22 16:12:31 +0100
commit7e12ebdf945d40d6f11872cf5852c9bb54d1864f (patch)
treed81f4661e2fd47f487cf0c9627baa1e21dc45b37 /game/GameScene.cpp
parent61148c757a1f742ff09e40e5347e74e638c7371c (diff)
big WIP
Diffstat (limited to 'game/GameScene.cpp')
-rw-r--r--game/GameScene.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/game/GameScene.cpp b/game/GameScene.cpp
index 2511567..57c6531 100644
--- a/game/GameScene.cpp
+++ b/game/GameScene.cpp
@@ -1,11 +1,3 @@
-#include "GameScene.h"
-#include "Config.h"
-#include "MoveCameraManualyScript.h"
-#include "PlayerSubScene.h"
-#include "StartGameScript.h"
-
-#include "background/BackgroundSubScene.h"
-
#include <cmath>
#include <crepe/api/Animator.h>
#include <crepe/api/Asset.h>
@@ -22,10 +14,20 @@
#include <crepe/api/Transform.h>
#include <crepe/types.h>
+#include "GameScene.h"
+#include "Config.h"
+#include "MoveCameraManualyScript.h"
+#include "StartGameScript.h"
+
+#include "background/BackgroundSubScene.h"
+#include "prefab/PlayerObject.h"
+
using namespace crepe;
using namespace std;
void GameScene::load_scene() {
+ logf(Log::DEBUG, "Loading (main) GameScene...");
+
BackgroundSubScene background(*this);
GameObject camera = new_object("camera", "camera", vec2(650, 0));
@@ -38,7 +40,7 @@ void GameScene::load_scene() {
camera.add_component<BehaviorScript>().set_script<MoveCameraManualyScript>();
camera.add_component<Rigidbody>(Rigidbody::Data {});
- PlayerSubScene player(*this);
+ PlayerObject player {new_object("player", "player", vec2(-100, 200))};
GameObject floor = new_object("floor", "game_world", vec2(0, 325));
floor.add_component<Rigidbody>(Rigidbody::Data {