Original Post
So i put my arkanoid game on hold for some more learning by tutorial. I found a really good one i think that skips the basics, the Tower defense tutorial. I have only done the firstpart and pretty much understand it all except for one line. Can someone explain what this does because i'm really clueless.
[color="#0000ff"]if (textureIndex == -1) [color="#0000ff"]continue;
It's inside the draw loop:
The comment by the creator tells me about all the obvious things except for that line.
[color="#0000ff"]if (textureIndex == -1) [color="#0000ff"]continue;
It's inside the draw loop:
public void Draw(SpriteBatch batch)
{
for (int x = 0; x < Width; x++)
{
for (int y = 0; y < Height; y++)
{
int textureIndex = map[y, x];
if (textureIndex == -1) continue;
Texture2D texture = tiletexture[textureIndex];
batch.Draw(texture, new Rectangle(x * 32, y * 32, 32, 32), Color.White);
}
}
}
The comment by the creator tells me about all the obvious things except for that line.