diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-01-04 23:08:13 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-01-04 23:08:13 +0100 |
commit | 78f847a25d37819515468fb39e214d354f889c70 (patch) | |
tree | 2aa5d204f2460b38e6362a4e4b0c58b0fd5aa96d /src/weapon.cpp | |
parent | two levels. moved shooting logic elsewhere (diff) | |
download | threshold-78f847a25d37819515468fb39e214d354f889c70.tar.gz threshold-78f847a25d37819515468fb39e214d354f889c70.tar.bz2 threshold-78f847a25d37819515468fb39e214d354f889c70.tar.xz threshold-78f847a25d37819515468fb39e214d354f889c70.tar.zst threshold-78f847a25d37819515468fb39e214d354f889c70.zip |
shotty makes a sound
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); +} |