project-kyoku/src/classicgame/classicsprite.h

34 lines
865 B
C
Raw Normal View History

#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;
2021-06-11 12:58:44 -04:00
void setCoordinates(float x, float y, float trail_x, float trail_y) noexcept;
2021-06-23 18:43:13 -04:00
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:
2021-06-16 13:11:00 -04:00
sf::RectangleShape _prototype;
sf::RectangleShape _shape;
2021-06-11 12:58:44 -04:00
sf::RectangleShape _trail;
sf::Text _grade_text;
sf::Font _font;
bool _trail_fade = false;
};