public void Draw(SpriteBatch theSpriteBatch)
{
Random rand = new Random();
for(int y = 0; y < map.GetLength(0); y++) {
for(int x = 0; x < map.GetLength(1); x++) {
theSpriteBatch.Draw(tile[rand.Next(0,3)], new Rectangle(x*tileWidth,y*tileHeight,tileWidth,tileHeight),
Color.White);
}
}
}
When I do this it just flickers the tiles and constantly redraws them. What do I do to get the random effect with it only drawing once? Is there a way I could click on these tiles with the mouse and have them change? Also, is there a way to make one tile more prevalent than the others?