This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/effects/Bullet.h

37 lines
798 B
C
Raw Normal View History

/*
* Bullet.h
*
* Created on: 12.08.2012
* Author: Felix
*/
#ifndef DG_BULLET_H_
#define DG_BULLET_H_
#include "../particle/Particle.h"
/**
* Bullet particle fired by a weapon, may damage actors.
*/
class Bullet : public Particle {
// Public functions.
public:
2012-09-12 12:21:57 +00:00
Bullet(const Vector2f& position, b2World& world, const std::shared_ptr<sf::Texture>& texture,
Physical& shooter, float direction, int damage);
void onCollide(Physical& other, uint16 category);
bool doesCollide(Physical& other);
2012-09-12 12:21:57 +00:00
2012-09-11 17:20:17 +00:00
// Public variables.
public:
static const Vector2i SIZE;
// Private variables.
private:
static const float SPEED; //< If speed is too low, bullets push each other away on insert.
Physical& mShooter;
2012-09-12 12:21:57 +00:00
const int mDamage;
};
#endif /* DG_BULLET_H_ */