aboutsummaryrefslogtreecommitdiff
path: root/src/stars.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stars.c')
-rw-r--r--src/stars.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stars.c b/src/stars.c
index 2a6b9fa..6e95455 100644
--- a/src/stars.c
+++ b/src/stars.c
@@ -10,8 +10,8 @@ void initStars(Stars * stars) {
stars->starsUsed[i] = false;
}
-Vector3 generateStar() {
- SetRandomSeed(clock());
+Vector3 generateStar(unsigned int seed) {
+ SetRandomSeed(seed);
// Get direction.
Vector3 star = (Vector3){
@@ -45,7 +45,7 @@ void drawStars(Game * game, Stars * stars) {
stars->starsUsed[i] = false;
} else { // Reset star.
stars->starsUsed[i] = true;
- stars->stars[i] = Vector3Add(player->position, generateStar());
+ stars->stars[i] = Vector3Add(player->position, generateStar(time(NULL) + i));
}
}
}