#ifndef GRAPHICS_HPP #define GRAPHICS_HPP // Ball, Paddle #include #include #include #include "globals.hpp" struct Ball { Ball(sf::Vector2f pos) : velocity({ VELOCITY_X, VELOCITY_Y }) { object.setSize({ (float)SIZE_X / 2, (float)SIZE_X / 2 }); object.setPosition(pos); }; sf::Vector2f velocity; sf::RectangleShape object; }; struct Paddle { Paddle(sf::Vector2f pos) { rect.setSize({ SIZE_X, SIZE_Y }); rect.setPosition(pos); }; int points; sf::RectangleShape rect; }; void check_and_move(); void handle_ball(); extern Paddle p1; extern Paddle p2; extern Ball ball; #endif