diff options
Diffstat (limited to 'src/weapon.cpp')
-rw-r--r-- | src/weapon.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/weapon.cpp b/src/weapon.cpp index c876481..a774676 100644 --- a/src/weapon.cpp +++ b/src/weapon.cpp @@ -8,8 +8,19 @@ #include "weapon.hpp" -Weapon::Weapon(float const & rg, unsigned int const & dmg) : +Weapon::Weapon(float const & rg, unsigned int const & dmg, const char *s, const char *r) : range(rg), damage(dmg) -{} +{ + InitAudioDevice(); + shot = LoadSound(s); + reload = LoadSound(r); + SetSoundVolume(shot, 0.3f); + SetSoundVolume(reload, 0.3f); +} Weapon::~Weapon() {} + +void Weapon::bang() const +{ + PlaySound(shot); +} |