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 3f893884e4db70a5abac24428fef6aeac5bced79
parent 25cce6c63a77c48903cbb0d99bd759ab1d76d789
Author: Henry Unite <unitehenry@gmail.com>
Date:   Sat, 18 Apr 2026 23:23:10 +0000

chore: format

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

diff --git a/src/game.c b/src/game.c @@ -1,7 +1,7 @@ #include "raylib.h" #include <emscripten/emscripten.h> -#include <stdio.h> #include <math.h> +#include <stdio.h> #define MainLoop emscripten_set_main_loop @@ -23,7 +23,8 @@ float backgroundScroll = 0.0f; float baseScroll = 0.0f; void draw_message() { - if (screen != TITLE) return; + if (screen != TITLE) + return; if (!IsTextureValid(messageTexture)) { messageTexture = LoadTexture("assets/sprites/message.png"); @@ -45,9 +46,11 @@ void draw_background() { backgroundScroll -= scrollSpeed; - DrawTexture(backgroundTexture, (int) fmodf(backgroundScroll, (float) screenWidth), 0, WHITE); + DrawTexture(backgroundTexture, + (int)fmodf(backgroundScroll, (float)screenWidth), 0, WHITE); - DrawTexture(backgroundTexture, (int) fmodf(backgroundScroll, (float) screenWidth) + screenWidth, 0, + DrawTexture(backgroundTexture, + (int)fmodf(backgroundScroll, (float)screenWidth) + screenWidth, 0, WHITE); } @@ -74,15 +77,19 @@ void draw_base() { baseTexture = LoadTexture("assets/sprites/base.png"); } - float bottomY = screenHeight - baseTexture.height + (baseTexture.height / 2.0f); + float bottomY = + screenHeight - baseTexture.height + (baseTexture.height / 2.0f); static const float scrollSpeed = 1.2f; baseScroll -= scrollSpeed; - DrawTexture(baseTexture, (int) fmodf(baseScroll, (float) screenWidth), bottomY, WHITE); + DrawTexture(baseTexture, (int)fmodf(baseScroll, (float)screenWidth), bottomY, + WHITE); - DrawTexture(baseTexture, (int) fmodf(baseScroll, (float) screenWidth) + screenWidth, bottomY, WHITE); + DrawTexture(baseTexture, + (int)fmodf(baseScroll, (float)screenWidth) + screenWidth, bottomY, + WHITE); } void draw(void) {