add parentheses

This commit is contained in:
Quinn
2024-09-04 16:16:08 +02:00
parent 8ba81e2090
commit 748ac2463e

View File

@@ -51,7 +51,7 @@ void level_init(Level* level) {
static void update_player(Bouncer* bouncer, Ball* ball, const Uint8* keys) {
// if move bouncer LEFT
if (keys[SDL_SCANCODE_A] || keys[SDL_SCANCODE_LEFT]) {
if (bouncer->pos.x < 0 == false) {
if ((bouncer->pos.x) < 0 == false) {
bouncer->pos.x -= BOUNCER_SPEED;
if (ball->moving == false)
@@ -61,7 +61,7 @@ static void update_player(Bouncer* bouncer, Ball* ball, const Uint8* keys) {
// if move bouncer RIGHT
if (keys[SDL_SCANCODE_D] || keys[SDL_SCANCODE_RIGHT]) {
if ((bouncer->pos.x + bouncer->width) > SCREEN_WIDTH == false) {
if (((bouncer->pos.x + bouncer->width) > SCREEN_WIDTH) == false) {
bouncer->pos.x += BOUNCER_SPEED; // increase the bouncer pos
if (ball->moving == false)