I'm starting out with xna, I'm pretty newbie with this, but I'm making my efforts to go on with this framework, anymay, my problem is:
that I have many .png images and dont want to make an object for any of those images so I want to put them up in a Texture2D
array, I thought that this is way to do it, but looks like it's not the correct way:
Texture2D[] _rCards, _bCards, _sCards;
_bCards = new Texture2D[9];
_rCards = new Texture2D[9];
_sCards = new Texture2D[6];
for (int i = 1; i < 10; i++)
{
_bCards[i] = Content.Load<Texture2D>("Images/Common/Black/"+i);
_rCards[i] = Content.Load<Texture2D>("Images/Common/Red/"+i);
if(i<6)
_sCards[i] = Content.Load<Texture2D>("Images/Special/Card" + (i-1));
}
The file names for the texture are 1.png, 2.png, 3.png, and so on.
For the special cards are card1.png, card2.png,card3.png and so on.
I'm trying to make a blackjack game.
Can you give me an advice to load all this textures in one single texture2D array.
The IDE gives an NULLREFERENCEEXCEPTION issue or something.
Maybe the language doesnt understands the entire adress to find the textures as a string.