SFML Pong, but object oriented

Ball.h 514B

12345678910111213141516171819202122
  1. #include <SFML/Graphics.hpp>
  2. #include <SFML/Audio.hpp>
  3. class Ball : public sf::CircleShape {
  4. private:
  5. float x,
  6. y,
  7. radius = 10;
  8. const float ballSpeed = 400;
  9. public:
  10. Ball();
  11. Ball(int radius);
  12. void move(float x, float y);
  13. void setPosition(float x, float y);
  14. float getX() const;
  15. float getY() const;
  16. float getSpeed() const;
  17. float getRadius() const;
  18. void render(sf::RenderWindow) const;
  19. };