diff options
| author | ilotterytea <iltsu@alright.party> | 2024-12-10 21:56:43 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-12-10 21:56:43 +0500 |
| commit | cbeb0314a90edb5ce28df2a8892160c0023320cb (patch) | |
| tree | a1db4e616fac8f764357e24e812089bc75b68c94 /src/star.c | |
| parent | a7d86efdb931a9587f0dffa1542569a562ce9a1b (diff) | |
feat: random velocity
Diffstat (limited to 'src/star.c')
| -rw-r--r-- | src/star.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -23,7 +23,12 @@ Vector3 Generate3DPosition() { } Star StarCreate() { - return (Star){Generate3DPosition(), {1, 1}, {0, 0}, 0.25f, BLACK}; + double velocity = + rand() % (STAR_MAX_VELOCITY + 1 - STAR_MIN_VELOCITY) + STAR_MIN_VELOCITY; + + velocity /= 100.0; + + return (Star){Generate3DPosition(), {1, 1}, {0, 0}, velocity, BLACK}; } void StarUpdate(Star *star) { |
