Made bullet size a public constant.

This commit is contained in:
Felix Ableitner 2012-09-11 19:20:17 +02:00
parent 6ea371ee2e
commit b782614bc4
2 changed files with 5 additions and 1 deletions

View file

@ -10,6 +10,7 @@
#include "../abstract/Actor.h" #include "../abstract/Actor.h"
#include "../util/Log.h" #include "../util/Log.h"
const Vector2i Bullet::SIZE = Vector2i(20, 20);
const float Bullet::SPEED = 500.0f; const float Bullet::SPEED = 500.0f;
/** /**
@ -21,7 +22,7 @@ const float Bullet::SPEED = 500.0f;
*/ */
Bullet::Bullet(const Vector2f& position, b2World& world, Bullet::Bullet(const Vector2f& position, b2World& world,
const std::shared_ptr<sf::Texture>& texture, Physical& shooter, float direction, int damage) : const std::shared_ptr<sf::Texture>& texture, Physical& shooter, float direction, int damage) :
Particle(texture, PhysicalData(position, Vector2i(20, 20), world, CATEGORY_PARTICLE, Particle(texture, PhysicalData(position, SIZE, world, CATEGORY_PARTICLE,
CATEGORY_PARTICLE, true, true)), CATEGORY_PARTICLE, true, true)),
mShooter(shooter), mShooter(shooter),
mDamage(damage) { mDamage(damage) {

View file

@ -22,6 +22,9 @@ public:
void onCollide(Physical& other, uint16 category); void onCollide(Physical& other, uint16 category);
bool doesCollide(Physical& other); bool doesCollide(Physical& other);
// Public variables.
public:
static const Vector2i SIZE;
// Private variables. // Private variables.
private: private:
static const float SPEED; static const float SPEED;