aboutsummaryrefslogtreecommitdiff
path: root/game/background/AquariumSubScene.cpp
diff options
context:
space:
mode:
authorMax-001 <maxsmits21@kpnmail.nl>2024-12-21 11:36:37 +0100
committerMax-001 <maxsmits21@kpnmail.nl>2024-12-21 11:36:37 +0100
commitd2af158ac63ab05b2fbfdcdf1b483662e48c0544 (patch)
tree14edc04fe7ddb4b85b151dfb857557fded5b2b93 /game/background/AquariumSubScene.cpp
parent9da9dd5a1ceb877dd6d822e91b3be2ffd4b43160 (diff)
Added Config.h
Diffstat (limited to 'game/background/AquariumSubScene.cpp')
-rw-r--r--game/background/AquariumSubScene.cpp146
1 files changed, 80 insertions, 66 deletions
diff --git a/game/background/AquariumSubScene.cpp b/game/background/AquariumSubScene.cpp
index 40e22b7..9994a9e 100644
--- a/game/background/AquariumSubScene.cpp
+++ b/game/background/AquariumSubScene.cpp
@@ -1,5 +1,7 @@
#include "AquariumSubScene.h"
+#include "../Config.h"
+
#include <crepe/api/Animator.h>
#include <crepe/api/GameObject.h>
#include <crepe/api/Scene.h>
@@ -15,21 +17,23 @@ float AquariumSubScene::create(Scene & scn, float begin_x) {
GameObject aquarium_begin
= scn.new_object("aquarium_begin", "background", vec2(begin_x, 0));
Asset aquarium_begin_asset{"asset/background/aquarium/glassTubeFG_1_TVOS.png"};
- aquarium_begin.add_component<Sprite>(aquarium_begin_asset, Sprite::Data{
- .sorting_in_layer = 4,
- .order_in_layer = 0,
- .size = vec2(0, 800),
- });
+ aquarium_begin.add_component<Sprite>(aquarium_begin_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACKGROUND,
+ .order_in_layer = 0,
+ .size = vec2(0, 800),
+ });
begin_x += 600;
GameObject aquarium_middle_1
= scn.new_object("aquarium_middle", "background", vec2(begin_x, 0));
Asset aquarium_middle_1_asset{"asset/background/aquarium/glassTubeFG_3_TVOS.png"};
- aquarium_middle_1.add_component<Sprite>(aquarium_middle_1_asset, Sprite::Data{
- .sorting_in_layer = 4,
- .order_in_layer = 2,
- .size = vec2(0, 800),
- });
+ aquarium_middle_1.add_component<Sprite>(aquarium_middle_1_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACKGROUND,
+ .order_in_layer = 2,
+ .size = vec2(0, 800),
+ });
begin_x += 400;
this->add_background(scn, begin_x - 200);
@@ -37,21 +41,23 @@ float AquariumSubScene::create(Scene & scn, float begin_x) {
GameObject aquarium_middle_2
= scn.new_object("aquarium_middle", "background", vec2(begin_x, 0));
Asset aquarium_middle_2_asset{"asset/background/aquarium/glassTubeFG_3_TVOS.png"};
- aquarium_middle_2.add_component<Sprite>(aquarium_middle_2_asset, Sprite::Data{
- .sorting_in_layer = 4,
- .order_in_layer = 3,
- .size = vec2(0, 800),
- });
+ aquarium_middle_2.add_component<Sprite>(aquarium_middle_2_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACKGROUND,
+ .order_in_layer = 3,
+ .size = vec2(0, 800),
+ });
begin_x += 400;
GameObject aquarium_middle_3
= scn.new_object("aquarium_middle", "background", vec2(begin_x, 0));
Asset aquarium_middle_3_asset{"asset/background/aquarium/glassTubeFG_3_TVOS.png"};
- aquarium_middle_3.add_component<Sprite>(aquarium_middle_3_asset, Sprite::Data{
- .sorting_in_layer = 4,
- .order_in_layer = 4,
- .size = vec2(0, 800),
- });
+ aquarium_middle_3.add_component<Sprite>(aquarium_middle_3_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACKGROUND,
+ .order_in_layer = 4,
+ .size = vec2(0, 800),
+ });
begin_x += 400;
this->add_background(scn, begin_x - 200);
@@ -59,22 +65,24 @@ float AquariumSubScene::create(Scene & scn, float begin_x) {
GameObject aquarium_middle_4
= scn.new_object("aquarium_middle", "background", vec2(begin_x, 0));
Asset aquarium_middle_4_asset{"asset/background/aquarium/glassTubeFG_3_TVOS.png"};
- aquarium_middle_4.add_component<Sprite>(aquarium_middle_4_asset, Sprite::Data{
- .sorting_in_layer = 4,
- .order_in_layer = 5,
- .size = vec2(0, 800),
- });
+ aquarium_middle_4.add_component<Sprite>(aquarium_middle_4_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACKGROUND,
+ .order_in_layer = 5,
+ .size = vec2(0, 800),
+ });
begin_x += 600;
this->add_background(scn, begin_x);
GameObject aquarium_end = scn.new_object("aquarium_end", "background", vec2(begin_x, 0));
Asset aquarium_end_asset{"asset/background/aquarium/glassTubeFG_2_TVOS.png"};
- aquarium_end.add_component<Sprite>(aquarium_end_asset, Sprite::Data{
- .sorting_in_layer = 4,
- .order_in_layer = 1,
- .size = vec2(0, 800),
- });
+ aquarium_end.add_component<Sprite>(aquarium_end_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACKGROUND,
+ .order_in_layer = 1,
+ .size = vec2(0, 800),
+ });
begin_x += 600;
return begin_x;
@@ -83,47 +91,53 @@ float AquariumSubScene::create(Scene & scn, float begin_x) {
void AquariumSubScene::add_background(Scene & scn, float begin_x) {
GameObject bg_1 = scn.new_object("aquarium_bg_1", "aquarium_background", vec2(begin_x, 0));
Asset bg_1_1_asset{"asset/background/aquarium/AquariumBG1_1_TVOS.png"};
- bg_1.add_component<Sprite>(bg_1_1_asset, Sprite::Data{
- .sorting_in_layer = 3,
- .order_in_layer = 2,
- .size = vec2(0, 400),
- .position_offset = vec2(-200, 100),
- });
+ bg_1.add_component<Sprite>(bg_1_1_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACK_BACKGROUND,
+ .order_in_layer = 2,
+ .size = vec2(0, 400),
+ .position_offset = vec2(-200, 100),
+ });
Asset bg_1_2_asset{"asset/background/aquarium/AquariumBG1_2_TVOS.png"};
- bg_1.add_component<Sprite>(bg_1_2_asset, Sprite::Data{
- .sorting_in_layer = 3,
- .order_in_layer = 2,
- .size = vec2(0, 400),
- .position_offset = vec2(200, 100),
- });
+ bg_1.add_component<Sprite>(bg_1_2_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACK_BACKGROUND,
+ .order_in_layer = 2,
+ .size = vec2(0, 400),
+ .position_offset = vec2(200, 100),
+ });
GameObject bg_2 = scn.new_object("aquarium_bg_2", "aquarium_background", vec2(begin_x, 0));
Asset bg_2_1_asset{"asset/background/aquarium/AquariumBG2_1_TVOS.png"};
- bg_2.add_component<Sprite>(bg_2_1_asset, Sprite::Data{
- .sorting_in_layer = 3,
- .order_in_layer = 1,
- .size = vec2(0, 400),
- .position_offset = vec2(200, -50),
- });
+ bg_2.add_component<Sprite>(bg_2_1_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACK_BACKGROUND,
+ .order_in_layer = 1,
+ .size = vec2(0, 400),
+ .position_offset = vec2(200, -50),
+ });
Asset bg_2_2_asset{"asset/background/aquarium/AquariumBG2_2_TVOS.png"};
- bg_2.add_component<Sprite>(bg_2_2_asset, Sprite::Data{
- .sorting_in_layer = 3,
- .order_in_layer = 1,
- .size = vec2(0, 400),
- .position_offset = vec2(-200, -50),
- });
+ bg_2.add_component<Sprite>(bg_2_2_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACK_BACKGROUND,
+ .order_in_layer = 1,
+ .size = vec2(0, 400),
+ .position_offset = vec2(-200, -50),
+ });
GameObject bg_3 = scn.new_object("aquarium_bg_3", "aquarium_background", vec2(begin_x, 0));
Asset bg_3_1_asset{"asset/background/aquarium/AquariumBG3_1_TVOS.png"};
- bg_3.add_component<Sprite>(bg_3_1_asset, Sprite::Data{
- .sorting_in_layer = 3,
- .order_in_layer = 0,
- .size = vec2(0, 400),
- .position_offset = vec2(200, -200),
- });
+ bg_3.add_component<Sprite>(bg_3_1_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACK_BACKGROUND,
+ .order_in_layer = 0,
+ .size = vec2(0, 400),
+ .position_offset = vec2(200, -200),
+ });
Asset bg_3_2_asset{"asset/background/aquarium/AquariumBG3_2_TVOS.png"};
- bg_3.add_component<Sprite>(bg_3_2_asset, Sprite::Data{
- .sorting_in_layer = 3,
- .order_in_layer = 0,
- .size = vec2(0, 400),
- .position_offset = vec2(-200, -200),
- });
+ bg_3.add_component<Sprite>(bg_3_2_asset,
+ Sprite::Data{
+ .sorting_in_layer = SORT_IN_LAY_BACK_BACKGROUND,
+ .order_in_layer = 0,
+ .size = vec2(0, 400),
+ .position_offset = vec2(-200, -200),
+ });
}