So I am trying to display a vector of blocks that will be randomly generated x and y eg.
[media]https://i.gyazo.com/782325225d1020bb2a4dec987a534383.png[/media]
however my code is displaying:
[media]https://i.gyazo.com/ce0aa34a4822fa3440deebc28a92427c.gif[/media]
I know why it is doing this but I dont know a better way of dealing with this. Any ideas?
my code:
for (int i = 0; i < block_vector.size(); i++)
{
if (block_vector[i].getPosition().x >= 320)
{
currentBlockPos.y = i + 32;
block_vector[i].setPosition(0, currentBlockPos.y);
}
else
{
currentBlockPos.x = i * 32;
block_vector[i].setPosition(currentBlockPos.x, currentBlockPos.y);
}
}