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.
2012-09-09 20:50:15 +00:00
|
|
|
/*
|
|
|
|
* Bullet.h
|
|
|
|
*
|
|
|
|
* Created on: 12.08.2012
|
|
|
|
* Author: Felix
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DG_BULLET_H_
|
|
|
|
#define DG_BULLET_H_
|
|
|
|
|
|
|
|
#include "../particle/Particle.h"
|
|
|
|
|
2012-10-12 17:22:53 +00:00
|
|
|
class Yaml;
|
2012-09-14 18:39:56 +00:00
|
|
|
|
2012-09-09 20:50:15 +00:00
|
|
|
/**
|
|
|
|
* Bullet particle fired by a weapon, may damage actors.
|
|
|
|
*/
|
|
|
|
class Bullet : public Particle {
|
|
|
|
public:
|
2013-03-30 15:39:46 +00:00
|
|
|
explicit Bullet(const sf::Vector2f& position, Sprite& shooter,
|
2013-03-30 01:30:11 +00:00
|
|
|
sf::Vector2f direction, const Yaml& config);
|
2012-09-09 20:50:15 +00:00
|
|
|
|
2013-03-03 20:28:12 +00:00
|
|
|
void onCollide(std::shared_ptr<Sprite> other);
|
2012-09-09 20:50:15 +00:00
|
|
|
|
2012-09-09 20:50:15 +00:00
|
|
|
private:
|
2012-12-23 14:50:49 +00:00
|
|
|
Sprite& mShooter;
|
2012-10-12 17:22:53 +00:00
|
|
|
const int mDamage;
|
|
|
|
const float mSpeed;
|
2012-09-09 20:50:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* DG_BULLET_H_ */
|