I usually turn to the XNA forums for help, but now they do not work, so I came here.
I am making a new XNA game and I want to have a player class. At the moment, I have a main game class called Dots. This is the main game. This is how my class is Playerpresented at the moment:
namespace Dots
{
class Player : Microsoft.Xna.Framework.Game
{
Texture2D PlayerTexture;
Vector2 PlayerPosition;
public Player()
{
Content.RootDirectory = "Content";
PlayerTexture = Content.Load<Texture2D>("Player");
PlayerPosition = Vector2.Zero;
}
public void Update()
{
}
public void Draw(SpriteBatch SpriteBatch)
{
}
}
}
But I get an error that I cannot solve, how to solve it. Error:
Error loading "Player". GraphicsDevice component not found.
He throws it on this line: PlayerTexture = Content.Load<Texture2D>("Player");.
In the main class of the game, I see this line: Graphics = new GraphicsDeviceManager(this);but I have no idea what to do with it. Am I passing it on to the class Playeror what?
Any help is appreciated, thanks.