From 5231f1e361fa7be8980a6463877b942f167f27e7 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 11 Dec 2024 16:42:26 +0500 Subject: feat: fade in --- src/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.c b/src/main.c index 37788de..c3e69ff 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,4 @@ +#include #include #include "constants.h" @@ -47,6 +48,7 @@ int main(int argc, char* argv[]) { star->position.z -= star->velocity; if (star->position.z < 1.0) { + star->color.a = 0; star->position = Generate3DPosition(); } @@ -57,6 +59,9 @@ int main(int argc, char* argv[]) { StarUpdate(star, screen_center_x, screen_center_y); + star->color.a = + 255 / (star->position.z - 5 < 1 ? 1 : star->position.z - 5); + if (star->texture == NULL) { DrawRectangle(star->renderPosition.x, star->renderPosition.y, star->size.x, star->size.y, star->color); -- cgit v1.2.3