hello every one. i am making a brick breaker game and im trying to detect when the ball hits the bricks. something quite strange happens.
1 2 3 4 5 6 7 8 9
for(unsignedint i = 0; i < Bricks.size(); i++)
{
Brick* b = Bricks[i];
cout << b->y << endl;
if(bally+ballsize > 1.85-b->y)
{
cout << b->y << endl;
}
}
Bricks is the vector holding all the info about each brick. now the first cout statement says the real translated value of the bricks. the second one says 0 for all of them. can anyone please explain to me what i am doing wrong? thanks!
no b->y in line 4 is set to the value its meant to be there are 4 values ( 0, 0.25, 0.5, 1) and in line 7 they are all 0. this code is copied and pasted from the source code. im asking how could it have changed.