From a5854e1346c96ade73ae1e69ee8b7a6c94c78b07 Mon Sep 17 00:00:00 2001 From: Max-001 Date: Wed, 8 Jan 2025 13:21:21 +0100 Subject: Added coin animation --- game/coins/CoinSubScene.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'game/coins/CoinSubScene.cpp') diff --git a/game/coins/CoinSubScene.cpp b/game/coins/CoinSubScene.cpp index 3bd6641..d154819 100644 --- a/game/coins/CoinSubScene.cpp +++ b/game/coins/CoinSubScene.cpp @@ -40,5 +40,25 @@ int CoinSubScene::create(Scene & scn, int coin_counter) { } ); coin.add_component(Asset {"asset/sfx/coin_pickup_1.ogg"}).volume = 3; + + Sprite & pick_up = coin.add_component( + 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( + pick_up, ivec2 {64, 64}, uvec2 {5, 1}, + Animator::Data { + .fps = 5, + .looping = false, + } + ) + .active + = false; + return coin_counter; } -- cgit v1.2.3