You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
865 B
C++

#pragma once
#include "sprite.h"
#include "SFML/Graphics/RectangleShape.hpp"
#include "SFML/Graphics/Text.hpp"
class ClassicSprite : public Sprite, public sf::Drawable
{
public:
ClassicSprite(const sf::RectangleShape& shape, const sf::Font &font);
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
virtual void reset() override;
void setCoordinates(float x, float y, float trail_x, float trail_y) noexcept;
std::pair<float, float> coordinates() const;
void update(float trail_x, float trail_y) noexcept;
void update() noexcept;
void pulse();
void fade();
void trailFade();
bool isDead() const;
private:
sf::RectangleShape _prototype;
sf::RectangleShape _shape;
sf::RectangleShape _trail;
sf::Text _grade_text;
sf::Font _font;
bool _trail_fade = false;
};