#ifndef BALL_H #define BALL_H #include #include #include "player.hh" class Ball { public: float ballspeed = 8.0f; int size = 16; float xvelocity; float yvelocity; float xvelSave; float yvelSave; SDL_Rect ball; void resetBall(Render &r, Player &p); Ball(Render& r, Player& p) { ball.y = p.player.y - (p.player.h / 2); yvelocity = ballspeed / 2; xvelocity = ball.x = 0; ball.w = ball.h = size; ball.x = r.width / 2 - (size / 2); } }; #endif