summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-12-10 19:54:30 +0500
committerilotterytea <iltsu@alright.party>2024-12-10 19:54:30 +0500
commit4ad320a53a4b030d2fe7b923024e78a0217a3b82 (patch)
treea549a4435d039d4a7071d7aa90ea9fddd3de23b4 /src
parentc664ddaf47e078219b848b9e2d9c3c4241420261 (diff)
fix: positions werent random
Diffstat (limited to 'src')
-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;