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

36 lines
692 B
C
Raw Normal View History

/*
* Bullet.h
*
* Created on: 12.08.2012
* Author: Felix
*/
#ifndef DG_BULLET_H_
#define DG_BULLET_H_
#include "../abstract/Circle.h"
2013-05-26 18:44:59 +00:00
class Character;
2012-10-12 17:22:53 +00:00
class Yaml;
/**
* Bullet particle fired by a weapon, may damage actors.
*/
class Bullet : public Circle {
public:
2013-05-26 18:44:59 +00:00
explicit Bullet(const sf::Vector2f& position, Character& shooter,
sf::Vector2f direction, const Yaml& config, float speed,
2013-07-06 11:22:55 +00:00
float damage, float maxRange);
2013-03-03 20:28:12 +00:00
void onCollide(std::shared_ptr<Sprite> other);
private:
2013-05-26 18:44:59 +00:00
const Character& mShooter;
2012-10-12 17:22:53 +00:00
const int mDamage;
2013-07-06 11:22:55 +00:00
const float mSpeed;
const float mMaxRangeSquared;
sf::Vector2f mStartPoint;
};
#endif /* DG_BULLET_H_ */