From b5ed442444d7243935f7ba58c7d0e0ada743d230 Mon Sep 17 00:00:00 2001 From: Max-001 Date: Wed, 8 Jan 2025 12:52:52 +0100 Subject: Added coin pickup sound --- game/coins/CoinScript.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'game/coins/CoinScript.cpp') diff --git a/game/coins/CoinScript.cpp b/game/coins/CoinScript.cpp index 90150b6..c5ca62c 100644 --- a/game/coins/CoinScript.cpp +++ b/game/coins/CoinScript.cpp @@ -5,6 +5,7 @@ #include "../Config.h" #include "../hud/HudScript.h" +#include #include #include @@ -29,6 +30,13 @@ bool CoinScript::on_collision(const CollisionEvent & collisionData) { .active = false; this->amount++; + + AudioSource & audio = this->get_components_by_id( + collisionData.info.other.metadata.game_object_id + ) + .front(); + audio.play(); + return false; } -- cgit v1.2.3