Original Post
Hello, I'm new to this forum and pretty new to C# and XNA (Still lerning a lot of C# and i'm NOT giving that shit up cus i KNOW i can lern it if i reallt try).
ive made a 2d sprite -map, more or less.. it looks like this when the loop is finishd:
############
#-----------------#
#-----------------#
#-----------------#
############
Its all 32x32px squares and the sprites are drawn verry nice.. The only problem is.. I dont know how to loop the rectangles so i can find out the bounds.
the only rectangle that work is the far bottom right, I think i know the problem but not how to solv it.
I think i need several new names for the rectangles or loop them.. If you would be kind to explain it to me it would be verry helpfull.
here are some of my code(Its all in the DRAW method):
UPPDATE, this is the code im working with, the other one was the old one, from some wierd tutorial. Om sorry to confuse you.
ive made a 2d sprite -map, more or less.. it looks like this when the loop is finishd:
############
#-----------------#
#-----------------#
#-----------------#
############
Its all 32x32px squares and the sprites are drawn verry nice.. The only problem is.. I dont know how to loop the rectangles so i can find out the bounds.
the only rectangle that work is the far bottom right, I think i know the problem but not how to solv it.
I think i need several new names for the rectangles or loop them.. If you would be kind to explain it to me it would be verry helpfull.
here are some of my code(Its all in the DRAW method):
for (int i = 0; i < levels.level_0.GetLength(0); ++i)
for (int j = 0; j < levels.level_0.GetLength(1); ++j)
{
Vector2 tilePos = new Vector2(j * 32, i * 32);
if (levels.level_0[i, j] == 1)
{
mazeBounds = new Rectangle((int)tilePos.X, (int)tilePos.Y, 32, 32);
spriteBatch.Draw(mapBrick, tilePos, Color.White);
}
}
UPPDATE, this is the code im working with, the other one was the old one, from some wierd tutorial. Om sorry to confuse you.