summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index c3e69ff..135c7ad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include "constants.h"
+#include "math.h"
#include "raylib.h"
#include "star.h"
#include "stdlib.h"
@@ -57,6 +58,13 @@ int main(int argc, char* argv[]) {
float screen_center_y =
mouse_control ? GetMouseY() : GetScreenHeight() / 2.0;
+ if (star->position.z <= 5.0) {
+ int x = abs((int)pow(star->renderPosition.x, star->position.z / 10.0));
+
+ if (star->renderPosition.x < screen_center_x) star->position.x -= x;
+ if (star->renderPosition.x > screen_center_x) star->position.x += x;
+ }
+
StarUpdate(star, screen_center_x, screen_center_y);
star->color.a =