Beginner C# image loading woes - NullReferenceException
- by Seth Taddiken
I keep getting a "NullReferenceExeption was unhandled" with "Object reference not set to an instance of an object." written under it. I have all of the images (png) correct with names and added to references.
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
backGround = Content.Load<Texture2D>("Cracked");
player1.playerBlock = Content.Load<Texture2D>("square");
player2.playerBlock = Content.Load<Texture2D>("square2");
}