diff --git a/data/sounds/effects/hit.wav b/data/sounds/effects/hit.wav new file mode 100644 index 0000000..e2a2ee8 Binary files /dev/null and b/data/sounds/effects/hit.wav differ diff --git a/source/core/defaults/audio.hpp b/source/core/defaults/audio.hpp index 6000c0f..216d186 100644 --- a/source/core/defaults/audio.hpp +++ b/source/core/defaults/audio.hpp @@ -38,6 +38,7 @@ namespace Defaults::Sound { constexpr const char* EXPLOSION = "effects/explosion.wav"; // Explosión constexpr const char* EXPLOSION2 = "effects/explosion2.wav"; // Explosión alternativa constexpr const char* FRIENDLY_FIRE_HIT = "effects/friendly_fire.wav"; // Friendly fire hit + constexpr const char* HIT = "effects/hit.wav"; // Enemic ferit (primer impacte → HURT) constexpr const char* INIT_HUD = "effects/init_hud.wav"; // Para la animación del HUD constexpr const char* LASER = "effects/laser_shoot.wav"; // Disparo constexpr const char* LOGO = "effects/logo.wav"; // Logo diff --git a/source/game/entities/enemy.cpp b/source/game/entities/enemy.cpp index c0626be..197406a 100644 --- a/source/game/entities/enemy.cpp +++ b/source/game/entities/enemy.cpp @@ -8,6 +8,7 @@ #include #include +#include "core/audio/audio.hpp" #include "core/defaults.hpp" #include "core/entities/entity.hpp" #include "core/graphics/shape_loader.hpp" @@ -276,6 +277,7 @@ void Enemy::destruir() { void Enemy::herir(uint8_t shooter_id) { wounded_timer_ = Defaults::Enemies::Wounded::DURATION; last_hit_by_ = shooter_id; + Audio::get()->playSound(Defaults::Sound::HIT, Audio::Group::GAME); } void Enemy::applyImpulse(const Vec2& impulse) {