• Create Account

We're offering banner ads on our site from just \$5!

#ActualVortez

Posted 21 February 2014 - 09:46 PM

You just need to learn to use the modulo operator.

for(int i = 0; i < 30; i++)
{
spr[i].setTexture(tex);
spr[i].scale(sf::Vector2f(0.55f, 0.55f));

spr[i].setPosition(105.6f * (i % 10), y + (52.8f * (i / 10)));

}

#4Vortez

Posted 21 February 2014 - 09:46 PM

You just need to learn to use the modulo operator.

for(int i = 0; i < 20; i++)
{
spr[i].setTexture(tex);
spr[i].scale(sf::Vector2f(0.55f, 0.55f));

spr[i].setPosition(105.6f * (i % 10), y + (52.8f * (i / 10)));

}

#3Vortez

Posted 21 February 2014 - 09:44 PM

You just need to learn to use the modulo operator.

spr[i].setPosition(105.6f * (i % 10), y + (52.8f * (i / 10)));

#2Vortez

Posted 21 February 2014 - 09:43 PM

You just need to learn to use the modulo operator.

spr[i].setPosition(105.6f * (i % 10), y + (52.8f * (i / 10));

#1Vortez

Posted 21 February 2014 - 09:41 PM

You just need to learn to use the modulo operator.

spr[i].setPosition(105.6f * (i % 10), y + (52.8f * (i / 10));

PARTNERS