diff options
| -rw-r--r-- | src/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 = |
