aboutsummaryrefslogtreecommitdiff
path: root/game/GameScene.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/GameScene.cpp')
-rw-r--r--game/GameScene.cpp8
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));