aboutsummaryrefslogtreecommitdiff
path: root/game/background/BackgroundSubScene.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 12:17:36 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 12:17:36 +0100
commitdc5d46426b30303843e8746d514db6f55ce1495b (patch)
tree2b01a358b3daa4f55e54ca2c87f58becf83edeb8 /game/background/BackgroundSubScene.cpp
parent1a5744a3285a5ba5132fb4f6f031c27df1b64d33 (diff)
parentc9c9702edc58ff8f40b13dc6b86b216421f79e9b (diff)
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/enemyAI
Diffstat (limited to 'game/background/BackgroundSubScene.cpp')
-rw-r--r--game/background/BackgroundSubScene.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/game/background/BackgroundSubScene.cpp b/game/background/BackgroundSubScene.cpp
index 6fdc598..4bbd977 100644
--- a/game/background/BackgroundSubScene.cpp
+++ b/game/background/BackgroundSubScene.cpp
@@ -1,10 +1,14 @@
#include "BackgroundSubScene.h"
+#include "AquariumScript.h"
#include "AquariumSubScene.h"
#include "ForestSubScene.h"
+#include "HallwayScript.h"
#include "HallwaySubScene.h"
#include "StartSubScene.h"
+#include <crepe/api/BehaviorScript.h>
#include <crepe/api/Color.h>
+#include <crepe/api/Scene.h>
using namespace crepe;
using namespace std;
@@ -23,15 +27,11 @@ BackgroundSubScene::BackgroundSubScene(Scene & scn) {
begin_x = forest.create(scn, begin_x, "1");
- begin_x = hallway.create(scn, begin_x, 2, Color::MAGENTA);
+ begin_x += 3000;
begin_x = aquarium.create(scn, begin_x);
- begin_x = hallway.create(scn, begin_x, 3, Color::CYAN);
-
- begin_x = forest.create(scn, begin_x, "2");
-
- begin_x = hallway.create(scn, begin_x, 4, Color::GREEN);
-
- begin_x = aquarium.create(scn, begin_x);
+ GameObject scripts = scn.new_object("scrips_background", "background");
+ scripts.add_component<BehaviorScript>().set_script<HallwayScript>();
+ scripts.add_component<BehaviorScript>().set_script<AquariumScript>();
}