So I'm new to XNA and am attempting to draw multiple sprites to the screen in the easiest way. I want each sprite to be incremented in the X axis so that I am left with multiple sprites drawn across the screen.
I have defined:
Vector2 pos;
In the LoadContent
function I have:
pos = new Vector2(0, 0);
and in Draw
I have:
spriteBatch.Draw (circle, pos, Color.White); //Draws sprite to screen in correct position
spriteBatch.Draw(circle, (pos.X += 1), Color.White); //causes error and doesnt draw
Hopefully I've explained this well enough and you can see what I'm trying to do, the compiler doesn't agree with (pos.X += 50)
(me trying to increment the X
position by 50).
I know I could go about this a longer way and create a new Vector2
for each draw but that would create multiple lines of what I think surely is unnecessary code and there must be a quick way like this to go about doing it?