Need help understanding this lines of code

this is the object that the code is inside of so in this case its the Game object (ie. the code is inside of the Game class).

DrawString code you’ve shown is a shortcut for:

Vector2 myVector = new Vector2(10, 10);
_spriteBatch.DrawString(font, "Score : " + score, myVector, Color.Black);

DrawString requires you to pass in a Vector2 object which will have had new called somewhere in the program.

1 Like