24 lines
492 B
C++
24 lines
492 B
C++
#ifndef PROJECTILE_H
|
|
#define PROJECTILE_H
|
|
|
|
#include <SFML/Graphics/Sprite.hpp>
|
|
#include "Position.h"
|
|
|
|
class Projectile {
|
|
public:
|
|
Projectile(float x, float y, sf::Texture &texture);
|
|
sf::Sprite &getSprite();
|
|
void setSpeed(float speed);
|
|
bool isOutOfBounds() const;
|
|
virtual void update() = 0;
|
|
protected:
|
|
static sf::Texture texture;
|
|
sf::Sprite sprite;
|
|
Position position;
|
|
float speed;
|
|
bool outOfBounds;
|
|
~Projectile() = default;
|
|
};
|
|
|
|
#endif //PROJECTILE_H
|