Breakout
|
Represents Paddle in the game. More...
#include <Paddle.h>
Public Member Functions | |
Paddle (Vec2 position, Vec2 velocity, SDL_Renderer *renderer) | |
The constructor of the Paddle class that takes in initial position and velocity along with renderer as arguments. More... | |
void | Draw () |
This Method helps the paddle to be rendered on the screen. More... | |
Contact | checkCollision (Ball const &ball) |
This Method checks the collision of Paddle with ball and returns where the ball hit the paddle. More... | |
void | Reset () |
This method will reset the padddle to it's inital position and velocity. More... | |
void | Update (float dt, int WINDOW_WIDTH) |
This method will update the position of the paddle. More... | |
Public Attributes | |
Vec2 | velocity |
The velocity of the paddle. More... | |
Represents Paddle in the game.
The constructor of the Paddle class that takes in initial position and velocity along with renderer as arguments.
This Method checks the collision of Paddle with ball and returns where the ball hit the paddle.
ball | The object of the ball |
void Paddle::Draw | ( | ) |
This Method helps the paddle to be rendered on the screen.
void Paddle::Reset | ( | ) |
This method will reset the padddle to it's inital position and velocity.
void Paddle::Update | ( | float | dt, |
int | WINDOW_WIDTH | ||
) |
This method will update the position of the paddle.
dt | The time passed between each frame |
WINDOW_WIDTH | The width of the game window |
Vec2 Paddle::velocity |
The velocity of the paddle.