SFML Pong, but object oriented

123456789101112131415161718192021
  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. void render(sf::RenderWindow) const;
  18. };