summaryrefslogtreecommitdiff
path: root/src/star.c
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-12-11 13:12:28 +0500
committerilotterytea <iltsu@alright.party>2024-12-11 13:12:28 +0500
commitcf6f0f7038e7736f200f600c09f82ae350bc05b3 (patch)
tree5f2a62681f4c2e4780cfd0072e18e0a3516e6e2a /src/star.c
parent493b668742ceb28a4e10ca5016e652f9638429aa (diff)
upd: max and min for start pos z
Diffstat (limited to 'src/star.c')
-rw-r--r--src/star.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/star.c b/src/star.c
index 4676a8f..822b9cf 100644
--- a/src/star.c
+++ b/src/star.c
@@ -18,7 +18,9 @@ Vector3 Generate3DPosition() {
float x = radius * sin(angle);
float y = radius * cos(angle);
- Vector3 v = {x, y, STAR_START_POS_Z};
+ Vector3 v = {x, y,
+ rand() % (STAR_START_POS_Z_MAX + 1 - STAR_START_POS_Z_MIN) +
+ STAR_START_POS_Z_MIN};
return v;
}
@@ -38,7 +40,8 @@ void StarUpdate(Star *star, float screen_center_x, float screen_center_y) {
star->renderPosition.x = x;
star->renderPosition.y = y;
- float size = (STAR_START_POS_Z - star->position.z) / (0.2 * star->position.z);
+ float size =
+ (STAR_START_POS_Z_MAX - star->position.z) / (0.2 * star->position.z);
star->size.x = size;
star->size.y = size;