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