I'm sorry, I just must express my joy in writing a function that would normally take lots of attempts and debugging to get right, but it works now! First compile and run after switching up my whole pong program and it works!
here it is (please don't laugh because it would be real simple for you to do )
Code:
void InitBlocks()
{
int xcounter = 0;
int ycounter = 0;
BITMAP bm;
GetObject(blockstate1, sizeof(bm), &bm);
for(int x=0; x<=399; x++)
{
blocks[x].current_pic = &blockstate3;
blocks[x].health = 3;
blocks[x].height = bm.bmHeight;
blocks[x].width = bm.bmWidth;
if(lev1[xcounter][ycounter] == 1)
blocks[x].state = true;
else
blocks[x].state = false;
blocks[x].x = blocks[x].width * xcounter;
blocks[x].y = blocks[x].height * ycounter;
xcounter++;
if(xcounter == 20) //20 will not be processed
{
xcounter = 0;
ycounter++;
}
}
}