diff options
author | Jaro <59013720+JaroWMR@users.noreply.github.com> | 2025-01-08 14:40:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-08 14:40:13 +0100 |
commit | 91366375a7b2a9be670e4842604512254a9c116e (patch) | |
tree | 537c2cfa54f338734c91e74f6db078dddd578a96 /game/coins/CoinSubScene.cpp | |
parent | c9c9702edc58ff8f40b13dc6b86b216421f79e9b (diff) | |
parent | a24d1563931a19332ff2935f8d5998c997a4f94e (diff) |
Merge pull request #112 from lonkaars/max/game2
Max/game2
Diffstat (limited to 'game/coins/CoinSubScene.cpp')
-rw-r--r-- | game/coins/CoinSubScene.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/game/coins/CoinSubScene.cpp b/game/coins/CoinSubScene.cpp index 2c9feb6..d154819 100644 --- a/game/coins/CoinSubScene.cpp +++ b/game/coins/CoinSubScene.cpp @@ -39,6 +39,26 @@ int CoinSubScene::create(Scene & scn, int coin_counter) { .looping = true, } ); - coin.add_component<AudioSource>(Asset {"asset/sfx/coin_pickup_1.ogg"}); + coin.add_component<AudioSource>(Asset {"asset/sfx/coin_pickup_1.ogg"}).volume = 3; + + Sprite & pick_up = coin.add_component<Sprite>( + Asset {"asset/coin/coinCollect1_TVOS.png"}, + Sprite::Data { + .sorting_in_layer = SORT_IN_LAY_COINS, + .order_in_layer = 1, + .size = size * 2, + } + ); + pick_up.active = false; + coin.add_component<Animator>( + pick_up, ivec2 {64, 64}, uvec2 {5, 1}, + Animator::Data { + .fps = 5, + .looping = false, + } + ) + .active + = false; + return coin_counter; } |