2021-06-09 20:08:58 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "sprite.h"
|
|
|
|
#include "SFML/Graphics/RectangleShape.hpp"
|
2021-06-11 19:39:47 +02:00
|
|
|
#include "SFML/Graphics/Text.hpp"
|
2021-06-09 20:08:58 +02:00
|
|
|
|
|
|
|
class ClassicSprite : public Sprite, public sf::Drawable
|
|
|
|
{
|
|
|
|
public:
|
2021-06-11 19:39:47 +02:00
|
|
|
ClassicSprite(const sf::RectangleShape& shape, const sf::Font &font);
|
2021-06-09 20:08:58 +02:00
|
|
|
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
|
2021-06-16 17:16:18 +02:00
|
|
|
virtual void reset() override;
|
2021-06-09 20:08:58 +02:00
|
|
|
|
2021-06-11 18:58:44 +02:00
|
|
|
void setCoordinates(float x, float y, float trail_x, float trail_y) noexcept;
|
2021-06-11 19:39:47 +02:00
|
|
|
void update(float trail_x, float trail_y) noexcept;
|
2021-06-16 17:16:18 +02:00
|
|
|
void update() noexcept;
|
|
|
|
|
|
|
|
void pulse();
|
2021-06-11 19:39:47 +02:00
|
|
|
void fade();
|
|
|
|
bool isDead() const;
|
2021-06-09 20:08:58 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
sf::RectangleShape _shape;
|
2021-06-11 18:58:44 +02:00
|
|
|
sf::RectangleShape _trail;
|
2021-06-11 19:39:47 +02:00
|
|
|
sf::Text _grade_text;
|
|
|
|
sf::Font _font;
|
2021-06-09 20:08:58 +02:00
|
|
|
};
|