Added bullet damage constant.
This commit is contained in:
parent
d1a31cac3e
commit
59cd09ac16
2 changed files with 5 additions and 1 deletions
|
@ -12,6 +12,8 @@
|
||||||
#include "../util/Loader.h"
|
#include "../util/Loader.h"
|
||||||
#include "../util/ResourceManager.h"
|
#include "../util/ResourceManager.h"
|
||||||
|
|
||||||
|
const int Weapon::BULLET_DAMAGE = 10;
|
||||||
|
|
||||||
Weapon::Weapon(Physical& holder, Collection& collection, b2World& world) :
|
Weapon::Weapon(Physical& holder, Collection& collection, b2World& world) :
|
||||||
Emitter(collection),
|
Emitter(collection),
|
||||||
mHolder(holder),
|
mHolder(holder),
|
||||||
|
@ -34,5 +36,5 @@ Weapon::fire() {
|
||||||
std::shared_ptr<Particle>
|
std::shared_ptr<Particle>
|
||||||
Weapon::createParticle() {
|
Weapon::createParticle() {
|
||||||
return std::shared_ptr<Particle>(new Bullet(mHolder.getPosition(), mWorld, mBulletTexture,
|
return std::shared_ptr<Particle>(new Bullet(mHolder.getPosition(), mWorld, mBulletTexture,
|
||||||
mHolder, mHolder.getAngle(), 10));
|
mHolder, mHolder.getAngle(), BULLET_DAMAGE));
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ protected:
|
||||||
|
|
||||||
// Private variables.
|
// Private variables.
|
||||||
private:
|
private:
|
||||||
|
static const int BULLET_DAMAGE;
|
||||||
|
|
||||||
Physical& mHolder;
|
Physical& mHolder;
|
||||||
std::shared_ptr<sf::Texture> mBulletTexture;
|
std::shared_ptr<sf::Texture> mBulletTexture;
|
||||||
b2World& mWorld;
|
b2World& mWorld;
|
||||||
|
|
Reference in a new issue