#include "Ball.h" #include "Paddle.h" Ball::Ball() { setRadius(radius - 3); setOutlineThickness(3); setOutlineColor(sf::Color::Black); setFillColor(sf::Color::White); setOrigin(radius / 2, radius / 2); } Ball::Ball(int r) { setRadius(r - 3); setOutlineThickness(3); setOutlineColor(sf::Color::Black); setFillColor(sf::Color::White); setOrigin(r / 2, r / 2); radius = r; } float Ball::getX() const { return getPosition().x; } float Ball::getY() const { return getPosition().y; } void Ball::setPosition(float x, float y) { sf::Transformable::setPosition(x, y); } float Ball::getSpeed() const { return ballSpeed; } void Ball::move(float x, float y) { sf::Transformable::move(x, y); } Paddle::Paddle() { size.x = 25; size.y = 100; setSize(sf::Vector2f(25, 100) - sf::Vector2f(3, 3)); setOutlineThickness(3); setOutlineColor(sf::Color::Black); setFillColor(sf::Color(200, 200, 200)); setOrigin(sf::Vector2f(25, 100) / 2.f); } float Paddle::getY() const { return getPosition().y; } float Paddle::getX() const { return getPosition().x; } void Paddle::setPosition(float x, float y) { sf::Transformable::setPosition(x, y); } sf::Vector2f Paddle::getSize() const { return size; } void Paddle::move(float x, float y) { sf::Transformable::move(x, y); }