|
|
@ -74,6 +74,14 @@ raylib::Vector2 changeVelocityAfterCollision(Paddle paddle, Ball ball) {
|
|
|
|
float new_y_vel = abs(BASE_SPEED * sinf(bounce_angle)) * signum(ball.vel.y); /* Keep the sign of the y-velocity */
|
|
|
|
float new_y_vel = abs(BASE_SPEED * sinf(bounce_angle)) * signum(ball.vel.y); /* Keep the sign of the y-velocity */
|
|
|
|
|
|
|
|
|
|
|
|
return raylib::Vector2(new_x_vel, new_y_vel);
|
|
|
|
return raylib::Vector2(new_x_vel, new_y_vel);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Checks the number and type of the command-line arguments. Throws an exception
|
|
|
|
|
|
|
|
if the args are invalid. */
|
|
|
|
|
|
|
|
void check_num_args(int argc, char** argv) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* This function checks the command-line arguments passed to the program.
|
|
|
|
/* This function checks the command-line arguments passed to the program.
|
|
|
|