aboutsummaryrefslogtreecommitdiff
path: root/game/player/PlayerSubScene.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-07 14:14:21 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-07 14:14:21 +0100
commitca456c50a6a4f35832d7b9d8d1b8f5eecee0e148 (patch)
tree78163daa8384e18b894491ffc8d18e8f69b88d5d /game/player/PlayerSubScene.cpp
parent41f890863706ee8ede43021fe83b776b638a18b7 (diff)
parent80b2c59068f97ff69a2ba77788c4861b10535328 (diff)
merged
Diffstat (limited to 'game/player/PlayerSubScene.cpp')
-rw-r--r--game/player/PlayerSubScene.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/game/player/PlayerSubScene.cpp b/game/player/PlayerSubScene.cpp
index e6da6f7..f136605 100644
--- a/game/player/PlayerSubScene.cpp
+++ b/game/player/PlayerSubScene.cpp
@@ -1,11 +1,14 @@
#include "PlayerSubScene.h"
+#include "PlayerAudioScript.h"
#include "PlayerEndScript.h"
#include "PlayerScript.h"
#include "../Config.h"
#include "../coins/CoinScript.h"
+#include "api/Asset.h"
#include <crepe/api/Animator.h>
+#include <crepe/api/AudioSource.h>
#include <crepe/api/BoxCollider.h>
#include <crepe/api/CircleCollider.h>
#include <crepe/api/GameObject.h>
@@ -152,4 +155,49 @@ PlayerSubScene::PlayerSubScene(Scene & scn) {
player.add_component<BehaviorScript>().set_script<PlayerScript>().active = false;
player.add_component<BehaviorScript>().set_script<CoinScript>();
player.add_component<BehaviorScript>().set_script<PlayerEndScript>().active = false;
+
+ player.add_component<AudioSource>(Asset("asset/sfx/dud_zapper_lp.ogg"));
+ player.add_component<AudioSource>(Asset("asset/sfx/dud_zapper_pop.ogg"));
+ player.add_component<AudioSource>(Asset("asset/sfx/dud_fire.ogg"));
+ player.add_component<AudioSource>(Asset("asset/sfx/jetpack_firecracker_lp_01.ogg")).volume
+ = 0.1;
+ player.add_component<AudioSource>(Asset("asset/sfx/jetpack_firecracker_lp_02.ogg")).volume
+ = 0.1;
+ player.add_component<AudioSource>(Asset("asset/sfx/jetpack_firecracker_lp_03.ogg")).volume
+ = 0.1;
+ player.add_component<AudioSource>(Asset("asset/sfx/jetpack_firecracker_lp_04.ogg")).volume
+ = 0.1;
+ player.add_component<AudioSource>(Asset("asset/sfx/jetpack_firecracker_lp_05.ogg")).volume
+ = 0.1;
+ player.add_component<AudioSource>(Asset("asset/sfx/jetpack_firecracker_lp_06.ogg")).volume
+ = 0.1;
+ player.add_component<AudioSource>(Asset("asset/sfx/jetpack_firecracker_lp_07.ogg")).volume
+ = 0.1;
+ player.add_component<AudioSource>(Asset("asset/sfx/jetpack_firecracker_lp_08.ogg")).volume
+ = 0.1;
+
+ GameObject player_audio = scn.new_object("player_audio", "player_audio", vec2(0, 0));
+ player_audio.add_component<AudioSource>(Asset("asset/sfx/barefoot_step_left_1.ogg")).volume
+ = 3.0;
+ player_audio.add_component<AudioSource>(Asset("asset/sfx/barefoot_step_right_1.ogg"))
+ .volume
+ = 3.0;
+ player_audio.add_component<AudioSource>(Asset("asset/sfx/barefoot_step_left_2.ogg")).volume
+ = 3.0;
+ player_audio.add_component<AudioSource>(Asset("asset/sfx/barefoot_step_right_2.ogg"))
+ .volume
+ = 3.0;
+ player_audio.add_component<AudioSource>(Asset("asset/sfx/barefoot_step_left_3.ogg")).volume
+ = 3.0;
+ player_audio.add_component<AudioSource>(Asset("asset/sfx/barefoot_step_right_3.ogg"))
+ .volume
+ = 3.0;
+ player_audio.add_component<AudioSource>(Asset("asset/sfx/barefoot_step_left_4.ogg")).volume
+ = 3.0;
+ player_audio.add_component<AudioSource>(Asset("asset/sfx/barefoot_step_right_4.ogg"))
+ .volume
+ = 3.0;
+
+ player_audio.add_component<BehaviorScript>().set_script<PlayerAudioScript>().active
+ = false;
}