project-kyoku/modes/classicmode/game/classicsprite.h

36 lines
938 B
C
Raw Normal View History

#pragma once
#include "tools/mathutils.h"
#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(const Coordinates &coordinates, float trail_x, float trail_y) noexcept;
Coordinates coordinates() const;
2021-07-15 04:45:52 +02:00
Coordinates trailCoordinates() 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 19:11:00 +02:00
sf::RectangleShape _prototype;
sf::RectangleShape _shape;
2021-06-11 18:58:44 +02:00
sf::RectangleShape _trail;
sf::Text _grade_text;
sf::Font _font;
bool _trail_fade = false;
};