aboutsummaryrefslogtreecommitdiff
path: root/game/coins/CoinSubScene.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/coins/CoinSubScene.cpp')
-rw-r--r--game/coins/CoinSubScene.cpp22
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;
}