SDL_Renderer * renderer
Definition ball_test.cpp:25
Abstract base class for all ball types in the game.
Definition ball_base.hpp:23
float get_vel_x() const
Gets the x-velocity component of the ball.
Definition ball_base.hpp:125
float vel_y
Definition ball_base.hpp:158
virtual void render_object(SDL_Renderer *renderer)=0
Pure virtual method to render the ball.
float get_pos_y() const
Gets the y-coordinate of the ball.
Definition ball_base.hpp:143
void set_game_mode(int mode)
Definition ball_base.hpp:151
float pos_x
Definition ball_base.hpp:155
float vel_x
Definition ball_base.hpp:157
SDL_Color color
Definition ball_base.hpp:160
virtual ~BallBase()
Virtual destructor for proper cleanup in derived classes.
Definition ball_base.hpp:34
void set_color(const SDL_Color &new_color)
Sets the color of the ball.
Definition ball_base.hpp:102
void set_position(float x, float y)
Sets the position of the ball.
Definition ball_base.hpp:79
void random_direction_angle()
Randomizes the direction of the ball.
Definition ball_base.cpp:37
virtual SDL_Rect boundaries() const
Gets the collision boundaries of the ball.
Definition ball_base.hpp:112
virtual void reset()
Resets the ball to the center of the screen.
Definition ball_base.cpp:131
int game_mode
Definition ball_base.hpp:161
BallBase(float size=35.0f)
Constructor for BallBase.
Definition ball_base.cpp:24
float pos_y
Definition ball_base.hpp:156
float get_vel_y() const
Gets the y-velocity component of the ball.
Definition ball_base.hpp:131
virtual void update(float travel_time, class Paddle *paddle1, class Paddle *paddle2, User *player1, User *player2)
Updates the ball's position and handles collisions.
Definition ball_base.cpp:63
const float ball_size
Definition ball_base.hpp:159
void set_velocity(float velX, float velY)
Sets the velocity of the ball.
Definition ball_base.hpp:91
SDL_Color get_color() const
Gets the color of the ball.
Definition ball_base.hpp:149
int get_game_mode() const
Definition ball_base.hpp:152
float get_pos_x() const
Gets the x-coordinate of the ball.
Definition ball_base.hpp:137
Represents a player paddle/racket in the game.
Definition paddle.hpp:20
Represents a player in the game with name and score tracking.
Definition user.hpp:23
Header defining the User class for player management.