rayflap

A Flappy Bird clone written in C and compiled to WebAssembly.
git clone https://unitehenry.com/git/rayflap.git
Log | Files | Refs | README

commit c6c0dffe598b4f007e951c436103298e69f9a5e3
parent 55d2f48fc7e8e246dbff7b264709a6776da6cfcf
Author: Henry Unite <unitehenry@gmail.com>
Date:   Sun, 19 Apr 2026 01:45:02 +0000

feat: bird rect

Diffstat:
Msrc/game.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/game.c b/src/game.c @@ -24,6 +24,7 @@ Screen screen = TITLE; float backgroundScroll = 0.0f; float baseScroll = 0.0f; char *birdColor = NULL; +Rectangle birdRect = {0, 0, 0.0f, 0.0f}; void draw_message() { if (screen != TITLE) @@ -86,12 +87,14 @@ void draw_bird() { Rectangle source = {0, 0, (float)birdTexture.width, (float)birdTexture.height}; - Rectangle dest = {centerX, centerY + messageOffsetY, (float)birdTexture.width, - (float)birdTexture.height}; + birdRect.x = centerX; + birdRect.y = centerY + messageOffsetY; + birdRect.width = (float)birdTexture.width; + birdRect.height = (float)birdTexture.height; Vector2 origin = {0, 0}; - DrawTexturePro(birdTexture, source, dest, origin, 0.0f, WHITE); + DrawTexturePro(birdTexture, source, birdRect, origin, 0.0f, WHITE); } void draw_base() {