commit 55fe093b545fd408be38c4cafdd061c3790dc8ce parent d2027fab55328e50aa43b9cb2d28b85d33aac5b9 Author: Henry Unite <unitehenry@gmail.com> Date: Sun, 19 Apr 2026 17:21:29 +0000 refactor: bottom pipe y Diffstat:
| M | src/game.c | | | 11 | ++++++++--- |
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/game.c b/src/game.c @@ -220,11 +220,16 @@ Vector2 random_pipe_y() { float upperBound = screenHeight - pipeTexture.height + (unit * 8); float pipeY = lowerBound + fmodf(rand(), (upperBound - lowerBound + 1)); - ; + + float gap = (unit * 4); + + float bottomPipeY = pipeY; + + float topPipeY = pipeY - gap - pipeTexture.height; Vector2 pipeVector = { - pipeY, // bottom pipe Y - pipeY - (unit * 4) - pipeTexture.height // top pipe Y + bottomPipeY, + topPipeY }; return pipeVector;