-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The (one) ball starts at the top-center of the screen #25
Labels
depends
Depends on another Issue
Comments
richelbilderbeek
pushed a commit
that referenced
this issue
Oct 26, 2023
Test pseudocode:
|
True test code: const game g;
const auto screen_size{get_screen_size(g)};
const auto ball_coordinat{get_ball_center_coordinat(g)};
const auto screen_width{get_width(screen_size)};
const auto half_screen_width{screen_width / 2.0};
const auto ball_center_x{get_x(ball_coordinat)};
const auto ball_center_y{get_y(ball_coordinat)};
// Don't: never compare floating point values
// assert(ball_center_x == half_screen_width);
// assert(ball_center_y == 0.0);
// Do: add some room for rounding errors
assert(is_more_or_less_equal(ball_center_x, half_screen_width));
assert(is_more_or_less_equal(ball_center_y, 0.0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depends on:
The (one) ball starts at the top-center of the screen
The text was updated successfully, but these errors were encountered: