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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

19 lines
482 B
C++

#include "paddle.hpp"
Paddle::Paddle() {}
Paddle::Paddle(sf::Vector2f position, sf::Vector2f size) : position(position), size(size) {}
sf::FloatRect Paddle::getBorder() const
{
return {position.x - size.x / 2.0f, position.y - size.y / 2.0f, size.x, size.y};
}
void Paddle::draw(sf::RenderWindow& window)
{
static sf::RectangleShape shape{};
shape.setPosition(position - size / 2.0f);
shape.setSize(size);
shape.setFillColor(color);
window.draw(shape);
}