# Having trouble creating multiple sprites from one class

So I am trying to make more than one sprite using a single class but I cannot seem to get the sprites to be drawn at all or drawn in different places (they are all just on top of one another).

In my Game1 I have:

    Flag flag;
List<Flag> GameFlags = new List<Flag>();


flag = new Flag();
tempRectangle = new Rectangle(50, 500,tempTexture.Width / 3, tempTexture.Height / 3);
flag.SetSprite(tempTexture);
flag.SetRectangle(tempRectangle);

for (int i = 0; i < 2; i++)
{
flag.spriteRectangle.X += 100;
}


Then in Draw:

 foreach (Flag flag in GameFlags)
{
spriteBatch.Begin();
flag.Draw(spriteBatch);
spriteBatch.End();
}


The effect I am after is having 2 sprites spaced out by a specified amount of space. Image if the underscores were spacing and the zeros were sprites in the following:

0____________________________0

Any help and advice is appreciated.

TeaBelliedTitch.

• You should move your spriteBatch.Begin() and spriteBatch.End() calls out of the loop. You only need to call them once in this context. Put begin before the loop and end after. – Keeleon Mar 19 '16 at 0:39

for (int i = 0; i < 2; i++)

• Yes, they are going to want new Flag()s at the start of each loop iteration. – lozzajp Mar 2 '17 at 16:52