Advertisement

a simple map question

Started by March 04, 2001 01:23 AM
0 comments, last by omegasyphon 23 years, 11 months ago
ok if a define a map like so map[10][10]; then when i make a map file like this 1111111111 1111111111 .. . 1111111111 when i go to draw this does it matter if i start at 0 or 1? also why does the following code below cause my program to basically quit during run time. it starts to load then it basically stalls on the following code. i think it cant write to the hard drive because it works fine if i comment this code out
  
	while(!fout.eof())
	{
		for(x=0;x<10;x++)
		{
			for(y=0;y<13;y++)
			{
				fout<<map.maplayer1[y][x];
			}
		}
	}
	fout.close();
  
Edited by - omegasyphon on March 4, 2001 2:50:22 AM
quote:
Original post by omegasyphon

ok if a define a map like so
map[10][10];

then when i make a map file like this
1111111111
1111111111
..
.
1111111111

when i go to draw this does it matter if i start at 0 or 1?

Yes, it does
quote:


also why does the following code below cause my program to
basically quit during run time. it starts to load then it basically stalls on the following code. i think it cant write to the hard drive because it works fine if i comment this code out

    	while(!fout.eof())	{		for(x=0;x<10;x++)		{			for(y=0;y<13;y++)			{				fout<<map.maplayer1[y][x];			}		}	}	fout.close();    

Why is there y<13 when your max y value == 9? Polish up your knowledge about arrays and then go on whit your current project.
- Good Luck -

This topic is closed to new replies.

Advertisement