diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-08 10:47:47 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-08 10:47:47 +0100 |
commit | 65cdd7966c276dd7b1ffec7bf0de243b9370eeb1 (patch) | |
tree | 938c6ed098f2141a6a5c2d56146325938ae868bd /game/StartGameScript.cpp | |
parent | 6112da75f973b1099fa95fcd9d3113c00302f5b4 (diff) | |
parent | ad5fb53986fcc3f3b3c5369574e0f8e95051f3d9 (diff) |
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/enemyAI
Diffstat (limited to 'game/StartGameScript.cpp')
-rw-r--r-- | game/StartGameScript.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/game/StartGameScript.cpp b/game/StartGameScript.cpp index 5698a53..3de577c 100644 --- a/game/StartGameScript.cpp +++ b/game/StartGameScript.cpp @@ -1,8 +1,10 @@ #include <iostream> #include "StartGameScript.h" #include "Config.h" +#include "api/BehaviorScript.h" #include <crepe/api/Animator.h> +#include <crepe/api/AudioSource.h> #include <crepe/api/ParticleEmitter.h> #include <crepe/api/Sprite.h> @@ -35,6 +37,14 @@ 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(); + + BehaviorScript & player_audio_script + = this->get_components_by_name<BehaviorScript>("player_audio").front(); + player_audio_script.active = true; + this->created_hole = true; } @@ -46,6 +56,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(true); + this->took_jetpack = true; } |