changed Color struct to 4 floats

GetRandomValue returns floats
added GetRandomInt
added Color4ub rgba 0-255
edited examples to work
colour palette values could bare a double check!
This commit is contained in:
Chris 2019-10-21 20:17:48 +01:00
commit b4d8f0b5d1

View file

@ -39,10 +39,10 @@ int main(void)
for (int i = 0; i < MAX_PARTICLES; i++)
{
mouseTail[i].position = (Vector2){ 0, 0 };
mouseTail[i].color = (Color){ GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 };
mouseTail[i].color = (Color){ GetRandomValue(0, 1), GetRandomValue(0, 1), GetRandomValue(0, 1), 1 };
mouseTail[i].alpha = 1.0f;
mouseTail[i].size = (float)GetRandomValue(1, 30)/20.0f;
mouseTail[i].rotation = (float)GetRandomValue(0, 360);
mouseTail[i].size = (float)GetRandomInt(1, 30)/20.0f;
mouseTail[i].rotation = (float)GetRandomInt(0, 360);
mouseTail[i].active = false;
}
@ -132,4 +132,4 @@ int main(void)
//--------------------------------------------------------------------------------------
return 0;
}
}