fix calls to GetRandomValue

This commit is contained in:
Bigfoot71 2025-05-10 21:45:42 +02:00
commit 0bfc37450c

View file

@ -43,7 +43,7 @@ int main(void)
SetTextureFilter(target.texture, TEXTURE_FILTER_BILINEAR); // Texture scale filter to use
Color colors[10] = { 0 };
for (int i = 0; i < 10; i++) colors[i] = (Color){ GetRandomValue(100, 250), GetRandomValue(50, 150), GetRandomValue(10, 100), 255 };
for (int i = 0; i < 10; i++) colors[i] = (Color){ GetRandomRangeInt(100, 250), GetRandomRangeInt(50, 150), GetRandomRangeInt(10, 100), 255 };
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@ -59,7 +59,7 @@ int main(void)
if (IsKeyPressed(KEY_SPACE))
{
// Recalculate random colors for the bars
for (int i = 0; i < 10; i++) colors[i] = (Color){ GetRandomValue(100, 250), GetRandomValue(50, 150), GetRandomValue(10, 100), 255 };
for (int i = 0; i < 10; i++) colors[i] = (Color){ GetRandomRangeInt(100, 250), GetRandomRangeInt(50, 150), GetRandomRangeInt(10, 100), 255 };
}
// Update virtual mouse (clamped mouse value behind game screen)