[color:#FF0000]int nMaxObjects = 0;[/color]
int ReadLevelBricks()
{
var fileHandle, strLen, nCounter, layerValue;
VECTOR brickPos;
PANEL* panBrick;
fileHandle = file_open_read("Level1.txt");
brickPos.x = initBrickX;
brickPos.y = initBrickY;
[color:#CC0000]int nBrickCounter = 0;[/color]
wait(3);
if (fileHandle)
{
while(file_str_read(fileHandle, strNumBricks) != -1)
{
strLen = str_len(strNumBricks);
layerValue = 1;
for (nCounter=0; nCounter< strLen; nCounter++)
{
str_cpy (strTemp, strNumBricks); //store the data being read to a temporary string
str_clip(strTemp, nCounter); //trim left
str_trunc(strTemp, strLen - nCounter - 1); //trim right
//if statetements here
}
brickPos.y += brickSpacing;
brickPos.x = initBrickX;
brickPos.y += brickHeight; //still need to add vertical space
}
}
return nBrickCounter;
file_close(fileHandle);
void main()
{
video_set(1024, 768, 32, 2);
fps_max=80;
mouse_pointer=0;
vec_set(screen_color, vector(178, 153, 128));
nMaxObjects = ReadLevelBricks();
}