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.
project-kyoku/src/classicgame/classicsprite.cpp

25 lines
622 B
C++

#include "classicsprite.h"
#include <SFML/Graphics/RenderTarget.hpp>
ClassicSprite::ClassicSprite(const sf::RectangleShape& shape) :
_shape(shape),
_trail(shape)
{}
void ClassicSprite::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
target.draw(_shape, states);
target.draw(_trail, states);
}
void ClassicSprite::setCoordinates(float x, float y, float trail_x, float trail_y) noexcept
{
_shape.setPosition(x, y);
_trail.setPosition(trail_x, trail_y);
}
void ClassicSprite::setTrailCoordinates(float trail_x, float trail_y) noexcept
{
_trail.setPosition(trail_x, trail_y);
}