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.
36 lines
938 B
C
36 lines
938 B
C
3 years ago
|
#pragma once
|
||
|
|
||
3 years ago
|
#include "tools/mathutils.h"
|
||
3 years ago
|
#include "sprite.h"
|
||
|
#include <SFML/Graphics/RectangleShape.hpp>
|
||
|
#include <SFML/Graphics/Text.hpp>
|
||
3 years ago
|
|
||
|
class ClassicSprite : public Sprite, public sf::Drawable
|
||
|
{
|
||
|
public:
|
||
3 years ago
|
ClassicSprite(const sf::RectangleShape& shape, const sf::Font &font);
|
||
3 years ago
|
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
|
||
3 years ago
|
virtual void reset() override;
|
||
3 years ago
|
|
||
3 years ago
|
void setCoordinates(const Coordinates &coordinates, float trail_x, float trail_y) noexcept;
|
||
|
Coordinates coordinates() const;
|
||
3 years ago
|
Coordinates trailCoordinates() const;
|
||
3 years ago
|
void update(float trail_x, float trail_y) noexcept;
|
||
3 years ago
|
void update() noexcept;
|
||
|
|
||
|
void pulse();
|
||
3 years ago
|
void fade();
|
||
3 years ago
|
void trailFade();
|
||
3 years ago
|
bool isDead() const;
|
||
3 years ago
|
|
||
|
private:
|
||
3 years ago
|
sf::RectangleShape _prototype;
|
||
|
|
||
3 years ago
|
sf::RectangleShape _shape;
|
||
3 years ago
|
sf::RectangleShape _trail;
|
||
3 years ago
|
sf::Text _grade_text;
|
||
|
sf::Font _font;
|
||
3 years ago
|
|
||
|
bool _trail_fade = false;
|
||
3 years ago
|
};
|