Skip to content

Commit

Permalink
Merge pull request #27 from ninadsachania/fix-ball-height-in-arkanoid
Browse files Browse the repository at this point in the history
Fix Ball Height Bug
  • Loading branch information
raysan5 authored Nov 29, 2024
2 parents f09c40f + 49c325d commit 4c94f3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classics/src/arkanoid.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void InitGame(void)
player.life = PLAYER_MAX_LIFE;

// Initialize ball
ball.position = (Vector2){ screenWidth/2, screenHeight*7/8 - 30 };
ball.position = (Vector2){ player.position.x, player.position.y - player.size.y/2 - ball.radius };
ball.speed = (Vector2){ 0, 0 };
ball.radius = 7;
ball.active = false;
Expand Down Expand Up @@ -175,7 +175,7 @@ void UpdateGame(void)
}
else
{
ball.position = (Vector2){ player.position.x, screenHeight*7/8 - 30 };
ball.position = (Vector2){ player.position.x, player.position.y - player.size.y/2 - ball.radius };
}

// Collision logic: ball vs walls
Expand Down

0 comments on commit 4c94f3b

Please sign in to comment.