I am attempting to create an asteroids game for university. However, when I am debugging the game, I keep getting an error stating that 'Object reference not set to an instance of an object.
The line of code that the debugger states where the error is, is:
Asteroidorigin.X = texture.Width / 2;
Asteroidorigin.Y = texture.Height / 2;
Asteroidorigin and texture are defined like this:
public Vector2 texture;
public Vector2 Asteroidorigin;
The code above looks all ok to me, so any help on this matter would be appreciated, Cheers