diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-17 10:26:55 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-17 10:26:55 +0100 |
commit | d106bd8b3e3f3ff50ca9032ab6c4819224666f3b (patch) | |
tree | 7244dffe9d42ac3c5f3f1e8d5cd0516b0e718f12 | |
parent | dfa0ad1f97fb49d281fd2eb0bf640c41727cab56 (diff) |
Added light
-rw-r--r-- | src/example/Start.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/example/Start.cpp b/src/example/Start.cpp index 9e194fe..59b6365 100644 --- a/src/example/Start.cpp +++ b/src/example/Start.cpp @@ -20,7 +20,8 @@ float Start::create(Scene & scn, float begin_x) { }); begin_x += 700; - this->add_table(begin, vec2(-125, 175)); + this->add_table(begin, vec2(-150, 150)); + this->add_light(begin, vec2(-125, -150)); GameObject end = scn.new_object("start_end", "background", vec2(begin_x, 0)); Asset end_asset{"asset/jetpack_joyride/background/start/titleFG_2_TVOS.png"}; @@ -81,3 +82,27 @@ void Start::add_table(GameObject & obj, vec2 offset) { .looping = true, }); } + +void Start::add_light(crepe::GameObject & obj, crepe::vec2 offset) { + Asset light_asset{"asset/jetpack_joyride/background/start/title_light_TVOS.png"}; + obj.add_component<Sprite>(light_asset, Sprite::Data{ + .sorting_in_layer = 5, + .order_in_layer = 0, + .size = vec2(0, 200), + .position_offset = offset, + }); + Asset light_glow_asset{"asset/jetpack_joyride/background/start/lightEffect2.png"}; + obj.add_component<Sprite>(light_glow_asset, Sprite::Data{ + .sorting_in_layer = 5, + .order_in_layer = 1, + .size = vec2(0, 50), + .position_offset = offset + vec2(0, 55), + }); + Asset light_effect_asset{"asset/jetpack_joyride/background/start/lightEffect.png"}; + obj.add_component<Sprite>(light_effect_asset, Sprite::Data{ + .sorting_in_layer = 5, + .order_in_layer = 0, + .size = vec2(0, 100), + .position_offset = offset + vec2(0, 350), + }); +} |