summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c4
-rw-r--r--src/star.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 3710ae1..3df220d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,8 +1,12 @@
#include "constants.h"
#include "raylib.h"
#include "star.h"
+#include "stdlib.h"
+#include "time.h"
int main(int argc, char *argv[]) {
+ srand(time(0));
+
InitWindow(800, 600, "hyperspace (demo)");
SetTargetFPS(60);
diff --git a/src/star.c b/src/star.c
index 6251e03..e8d2dfd 100644
--- a/src/star.c
+++ b/src/star.c
@@ -2,13 +2,11 @@
#include <math.h>
#include <stdlib.h>
-#include <time.h>
#include "constants.h"
#include "raylib.h"
Vector3 Generate3DPosition() {
- srand(time(0));
double random = (double)rand() / RAND_MAX;
double angle = random * 2.0 * M_PI;