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 e6c3d6cf3ae7528e758e1b956bb16ebcc1ab3946
parent 07637522ddd201b1a485973983d57e2aab30fb8f
Author: Henry Unite <unitehenry@gmail.com>
Date:   Sun, 19 Apr 2026 01:14:25 +0000

feat: title to play

Diffstat:
Msrc/game.c | 14++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/game.c b/src/game.c @@ -78,7 +78,7 @@ void draw_bird() { float messageOffsetY = 0; - if (screen == TITLE && IsTextureValid(messageTexture)) { + if (IsTextureValid(messageTexture)) { messageOffsetY = (messageTexture.height - birdTexture.height) / 5.1f; } @@ -119,10 +119,16 @@ void draw() { EndDrawing(); } -void update(void) { - if (IsMouseButtonReleased(0)) { - printf("left click\n"); +void input() { + if (!IsMouseButtonReleased(0)) return; + + if (screen == TITLE) { + screen = PLAY; } +} + +void update(void) { + input(); draw(); }