aboutsummaryrefslogtreecommitdiff
path: root/game/background/BackgroundSubScene.cpp
blob: 4bbd977a4c6f9807c6685f310d1be1a40f1d524f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#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;

BackgroundSubScene::BackgroundSubScene(Scene & scn) {
	StartSubScene start;
	HallwaySubScene hallway;
	ForestSubScene forest;
	AquariumSubScene aquarium;

	float begin_x = 400;

	begin_x = start.create(scn, begin_x);

	begin_x = hallway.create(scn, begin_x, 1, Color::YELLOW);

	begin_x = forest.create(scn, begin_x, "1");

	begin_x += 3000;

	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>();
}