Added sounds

This commit is contained in:
Vladislav Khorev committed 2026-07-07 23:05:01 +03:00
1 parent c6ba8bd008
commit 124208f2a4
26 files changed
+210 -36

No files matched your search

+13 -2
View File
@@ -419,6 +419,17 @@ void Character::update(int64_t deltaMs, const CharacterResolver& resolver) {
state.currentState == AnimationState::ACTION_ATTACK_2)) {
if (attackTarget != nullptr) {
attackTarget->applyDamage(10.f, attackDirectionToTarget());
if (audioPlayer) {
if (state.isPlayer)
{
audioPlayer->playSoundAsync("audio/547041__cogfirestudios__hit-swing-sword-small-3.ogg");
}
else
{
audioPlayer->playSoundAsync("audio/13925__adcbicycle__21.ogg");
}
}
}
}
@@ -1176,8 +1187,8 @@ void Character::drawNightCpuWithShadow(Renderer& renderer,
void Character::setupHitSparks(std::shared_ptr<Texture> sparkTexture) {
hitSparkEmitter.setTexture(sparkTexture);
hitSparkEmitter.setShaderProgramName("spark");
hitSparkEmitter.setMaxParticles(64);
hitSparkEmitter.setParticleSize(0.08f);
hitSparkEmitter.setMaxParticles(128);
hitSparkEmitter.setParticleSize(0.02f);
hitSparkEmitter.setBiasX(0.0f);
hitSparkEmitter.setEmissionRate(1.0e9f);
hitSparkEmitter.setSpeedRange(2.0f, 4.0f);