aboutsummaryrefslogtreecommitdiffstats
path: root/src/weapon.cpp
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-01-04 23:08:13 +0100
committersalaaad2 <arthurdurant263@gmail.com>2022-01-04 23:08:13 +0100
commit78f847a25d37819515468fb39e214d354f889c70 (patch)
tree2aa5d204f2460b38e6362a4e4b0c58b0fd5aa96d /src/weapon.cpp
parenttwo levels. moved shooting logic elsewhere (diff)
downloadthreshold-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.cpp15
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);
+}