Hey Guys, I'm here again with my problem:
I got some circles bouncing around in a window. But I want that the circles change their color when they collide with a wall.
This may seems very simple, but trust me, it's harder than It looks.
The problem I have, is that the colors are always similar.
Let me explain the problem more in detail:
I got a random function, which generates a random number between 1 and 255. I uses the elapsed time of a clock in microseconds as seed. The function works fine.
But now theres a problem: When I try to set the FillColor of the Circle like this:
Circle.setFillColor(sf::Color(Random(clockSeed) , Random(clockSeed) , Random(clockSeed));
The Circle will always get a grey color, because Red, Green and Blue have the same value.
Then I tried something like this:
Circle.setFillColor(sf::Color(Random(clockSeed * 2) , Random(clockSeed * clockSeed) , Random(clockSeed));
And a LOT of other methods to give each color a different value.
But that works neither, now the Circles have similar colors, because the 'proportions' of the color's values are always the same.
I have some Ideas for nasty solutions, but does anyone have an smart solution?
(Probably the solution is obvious and my brain is just stuck...)
Thanks In advance for your answers!