summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 5 insertions, 0 deletions
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 <stdio.h>
#include <stdlib.h>
#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);