diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2025-01-07 14:14:21 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2025-01-07 14:14:21 +0100 |
commit | ca456c50a6a4f35832d7b9d8d1b8f5eecee0e148 (patch) | |
tree | 78163daa8384e18b894491ffc8d18e8f69b88d5d /game/GameScene.cpp | |
parent | 41f890863706ee8ede43021fe83b776b638a18b7 (diff) | |
parent | 80b2c59068f97ff69a2ba77788c4861b10535328 (diff) |
merged
Diffstat (limited to 'game/GameScene.cpp')
-rw-r--r-- | game/GameScene.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/game/GameScene.cpp b/game/GameScene.cpp index a1f3fa6..fce8206 100644 --- a/game/GameScene.cpp +++ b/game/GameScene.cpp @@ -17,6 +17,7 @@ #include <cmath> #include <crepe/api/Animator.h> #include <crepe/api/Asset.h> +#include <crepe/api/AudioSource.h> #include <crepe/api/BehaviorScript.h> #include <crepe/api/BoxCollider.h> #include <crepe/api/Camera.h> @@ -85,6 +86,13 @@ void GameScene::load_scene() { HudSubScene hud; hud.create(*this); + GameObject background_music = new_object("background_music", "audio", vec2(0, 0)); + Asset background_music_asset {"asset/music/level.ogg"}; + background_music.add_component<AudioSource>(background_music_asset); + + GameObject boom_audio = new_object("boom_audio", "audio", vec2(0, 0)); + Asset boom_audio_asset {"asset/sfx/window_smash.ogg"}; + boom_audio.add_component<AudioSource>(boom_audio_asset); // zapper, laser and missile (below) for testing purpose only!!! GameObject zapper = new_object("zapper", "zapper", vec2(1000, 0)); |