diff options
author | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-06 13:21:23 +0100 |
---|---|---|
committer | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-06 13:21:23 +0100 |
commit | f2a24bc4f5956d7d59ae42fade277a7826e174da (patch) | |
tree | f14164639dfd119385a08d2e28a76a1103db8cdb /game/StartGameScript.cpp | |
parent | 77d02bf2e2d5d04e8cacb3c783446541517e8e76 (diff) |
First audio
Diffstat (limited to 'game/StartGameScript.cpp')
-rw-r--r-- | game/StartGameScript.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/game/StartGameScript.cpp b/game/StartGameScript.cpp index c786eb4..273666c 100644 --- a/game/StartGameScript.cpp +++ b/game/StartGameScript.cpp @@ -2,6 +2,7 @@ #include "Config.h" #include <crepe/api/Animator.h> +#include <crepe/api/AudioSource.h> #include <crepe/api/ParticleEmitter.h> #include <crepe/api/Sprite.h> @@ -34,6 +35,10 @@ void StartGameScript::fixed_update(crepe::duration_t dt) { emitter.active = true; } + AudioSource & boom_audio + = this->get_components_by_name<AudioSource>("boom_audio").front(); + boom_audio.play(); + this->created_hole = true; } @@ -45,6 +50,10 @@ void StartGameScript::fixed_update(crepe::duration_t dt) { Sprite & jetpack_sprite = this->get_components_by_name<Sprite>("player").back(); jetpack_sprite.active = true; + AudioSource & background_music + = this->get_components_by_name<AudioSource>("background_music").front(); + background_music.play(); + this->took_jetpack = true; } |