Added sounds
This commit is contained in:
1 parent
c6ba8bd008
commit
124208f2a4
26 files changed
+210
-36
No files matched your search
+4
-2
@@ -83,7 +83,7 @@ namespace ZL
|
||||
|
||||
// ---- Setup ----
|
||||
|
||||
void Location::setup(const LocationSetup& params, Quest::QuestJournal* journal)
|
||||
void Location::setup(const LocationSetup& params, Quest::QuestJournal* journal, AudioPlayerAsync* audioPlayer)
|
||||
{
|
||||
|
||||
// Load static game objects
|
||||
@@ -138,6 +138,7 @@ namespace ZL
|
||||
player->state.position = params.playerPosition;
|
||||
player->setTarget(params.playerPosition);
|
||||
player->setupHitSparks(sparkTexture);
|
||||
player->audioPlayer = audioPlayer;
|
||||
std::cout << "Load resurces step 9" << std::endl;
|
||||
|
||||
// Load NPCs from JSON. Aggressive (canAttack) NPCs need a player target
|
||||
@@ -149,6 +150,7 @@ namespace ZL
|
||||
npc->state.homePosition = Eigen::Vector3f(npc->state.position.x(), 0.f, npc->state.position.z());
|
||||
if (npc->state.canAttack) {
|
||||
npc->setupHitSparks(sparkTexture);
|
||||
npc->audioPlayer = audioPlayer;
|
||||
npc->state.attackTargetIndex = CharacterState::kPlayerIndex;
|
||||
}
|
||||
}
|
||||
@@ -179,7 +181,7 @@ namespace ZL
|
||||
npcNameText.reset();
|
||||
}
|
||||
|
||||
scriptEngine.init(this, &inventory, params.scriptPath);
|
||||
scriptEngine.init(this, &inventory, audioPlayer, params.scriptPath);
|
||||
scriptEngine.setQuestJournal(journal);
|
||||
|
||||
dialogueSystem.setOnCutsceneFinished([this](const std::string& cutsceneId) {
|
||||
|
||||
Reference in new issue
Block a user