diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-01-06 23:44:19 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-01-06 23:44:19 +0100 |
commit | a67d57e85601c6ebf69c1c6828125470035af393 (patch) | |
tree | 0d7b5d60b339e516d11fad7c38f98680724b8fc3 /src/weapon.cpp | |
parent | amazing textures. v0.0.4 (diff) | |
download | threshold-a67d57e85601c6ebf69c1c6828125470035af393.tar.gz threshold-a67d57e85601c6ebf69c1c6828125470035af393.tar.bz2 threshold-a67d57e85601c6ebf69c1c6828125470035af393.tar.xz threshold-a67d57e85601c6ebf69c1c6828125470035af393.tar.zst threshold-a67d57e85601c6ebf69c1c6828125470035af393.zip |
weapon as an abstract class. now make more weapons
Diffstat (limited to '')
-rw-r--r-- | src/weapon.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/weapon.cpp b/src/weapon.cpp index 62e6150..f357b40 100644 --- a/src/weapon.cpp +++ b/src/weapon.cpp @@ -10,7 +10,7 @@ #include <iostream> -Weapon::Weapon(float const & rg, unsigned int const & dmg, unsigned int const & mag, const char *s, const char *r) : +AWeapon::AWeapon(float const & rg, unsigned int const & dmg, unsigned int const & mag, const char *s, const char *r) : range(rg), damage(dmg), max(mag) { InitAudioDevice(); @@ -21,24 +21,11 @@ Weapon::Weapon(float const & rg, unsigned int const & dmg, unsigned int const & barrel = max; } -Weapon::~Weapon() {} +AWeapon::~AWeapon() {} -void Weapon::refill() +void AWeapon::refill() { std::cout << "reload" << std::endl; PlaySound(reload); barrel = max; } - -int Weapon::bang() -{ - if (barrel == 0) - { - return (1); - } else { - barrel--; - std::cout << "BANG : " << barrel << "shots left" << std::endl; - PlaySound(shot); - return (0); - } -} |