16
Graphics / Re: Shader is running really slow. Not sure what it is.
« on: February 17, 2014, 05:53:01 am »
I changed it to take up the entire 1280x720 resolution and it now runs at around 23 fps.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
The seed is to make the random generator behave differently on each run. If you did not set a seed, then the results would be the same each time you start the program. The balls would change colors in the same sequence every time the program is ran. That is the purpose of the seed, to prevent that.Yeah, I know what a seed does, but I didn't know if the new random needs a seed too, or if, for example, the system time is automatically used as seed.
It looks like you keep resetting the seed for the random function. Take a look at the <random> part of the stl. IT has a lot better functionality than the old random.Okay, I now I use the new random:default_random_engine engine;I use this no matter which border is touched:
uniform_int_distribution<int> distribution(1,255);
auto random = bind ( distribution, engine );
Ball[i].setFillColor(sf::Color(random(), random(), random()));
Now it definetely looks better, but do I need to set an extra seed for the generator?
Ok, still trying to fix my timestep, but meanwhile I added two features:
1. Outline can be (de-)activated by pressing the 'r' key
2. Circles change color when colliding with a window-border
But there's one thing I don't understand: It seems like the colors are always nearly the same. What did I do wrong?
Like Cadisol87 said, if you don't like a game, just don't play it
Or if you don't like a game, give constructive criticism and then don't play it. For example, "I feel the game has a difficulty curve too steep for me to enjoy it. It may of been beneficial to provide a lower difficulty option".
I'd rather someone politely tell me why they don't like something than just go "lol this sucks" and do no more
Also, beware of changing the velocity of one before you calculate the new velocity of the other. If you do not, then you will not have a correct collision.
I did that, didn't I?
(mass - mass)
Why are you now again using separate coordinates instead of vectors? I think we agreed that vectors would make the code simpler and more readable
And don't duplicate code, you can merge the four functions to one.
Have you already searched for "big integer c++" or "big decimal c++"?
GMP is a known library.
Out of curiosity, what do you need it for?
Forgive me for asking, but out of curiosity, what could you possibly need more than the 19.26 decimal digits that long double gives you? Also, I don't think there is any way to store any number larger without losing precision.
edit: I guess you can ignore this post, other higher beings are more knowledgeable