diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-17 11:57:25 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-17 11:57:25 +0100 |
commit | 24b415850da853496a6610e6fa00d4325b9a95c9 (patch) | |
tree | 31e1783b0ce12eb9ecfdb725f57f288e544b9c88 /src/example/Start.cpp | |
parent | 58dd5c74add6be4b4185b273291a30aec3f37fa5 (diff) |
Added basic player with some physics
Diffstat (limited to 'src/example/Start.cpp')
-rw-r--r-- | src/example/Start.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/example/Start.cpp b/src/example/Start.cpp index 2c46d34..846c34f 100644 --- a/src/example/Start.cpp +++ b/src/example/Start.cpp @@ -18,6 +18,14 @@ float Start::create(Scene & scn, float begin_x) { .order_in_layer = 0, .size = vec2(0, 800), }); + GameObject hole = scn.new_object("start_hole", "background", vec2(begin_x - 250, 140)); + Asset hole_asset{"asset/jetpack_joyride/background/start/titleWallHole.png"}; + Sprite & hole_sprite = hole.add_component<Sprite>(hole_asset, Sprite::Data{ + .sorting_in_layer = 4, + .order_in_layer = 1, + .size = vec2(0, 200), + }); + hole_sprite.active = false; begin_x += 700; this->add_table(begin, vec2(-150, 150)); @@ -54,6 +62,7 @@ void Start::add_lamp(GameObject & obj, vec2 offset, unsigned int fps) { .size = vec2(0, 300), .position_offset = offset - vec2(65, -55), }); + lamp_glow_sprite.active = false; obj.add_component<Animator>(lamp_glow_sprite, ivec2(422, 384), uvec2(6, 1), Animator::Data{ .fps = fps, |