For loop help

So this may be a very dumb question but I want to make that 650.0f go down by 490 everytime it loops. On first loop it being 650, second loop 160, third -330 and so on. How would I go about it?

1
2
3
4
  for (int i = 0; i < 10; i++)
	{
		platforms.push_back(Platform(&wallTexture, sf::Vector2f(500.0f, 500.0f), sf::Vector2f(1150.0f, 650.0f)));
	}
1
2
3
4
5
6
for (int i = 0; i < 10; i++)
	{
                float value = 650.0;
		platforms.push_back(Platform(&wallTexture, sf::Vector2f(500.0f, 500.0f), sf::Vector2f(1150.0f, value)));
                value -= 490;
	}



Would that suit your needs?
Hey, thanks for the reply. The results I got are 160 being printed out 10 times instead of the

650
160
-330
...
Ah never mind, I just took the float value = 650.0; out of the loop since it was setting it back to 650 ever time it looped
Thank you very much for the help
Ah never mind, I just took the float value = 650.0; out of the loop since it was setting it back to 650 ever time it looped

Yes, that was my bad. Glad it worked.
Topic archived. No new replies allowed.