diff options
author | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 13:21:21 +0100 |
---|---|---|
committer | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 13:21:21 +0100 |
commit | a5854e1346c96ade73ae1e69ee8b7a6c94c78b07 (patch) | |
tree | 6884f06ed672323adb7bc0e49ee98243817d62e3 /game/coins/CoinScript.cpp | |
parent | 2e65d249e04e1450a4c45a4fb5d48213a75cf3e0 (diff) |
Added coin animation
Diffstat (limited to 'game/coins/CoinScript.cpp')
-rw-r--r-- | game/coins/CoinScript.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/game/coins/CoinScript.cpp b/game/coins/CoinScript.cpp index c5ca62c..514f4de 100644 --- a/game/coins/CoinScript.cpp +++ b/game/coins/CoinScript.cpp @@ -5,6 +5,7 @@ #include "../Config.h" #include "../hud/HudScript.h" +#include <crepe/api/Animator.h> #include <crepe/api/AudioSource.h> #include <crepe/api/CircleCollider.h> #include <crepe/api/Sprite.h> @@ -37,6 +38,17 @@ bool CoinScript::on_collision(const CollisionEvent & collisionData) { .front(); audio.play(); + this->get_components_by_name<Sprite>(collisionData.info.other.metadata.name) + .back() + .get() + .active + = true; + this->get_components_by_name<Animator>(collisionData.info.other.metadata.name) + .back() + .get() + .active + = true; + return false; } |