Okay, I'm writing a game in C#/XNA 4.0 and am utterly stumped at my current juncture: Sprite animation. I understand how it works and have all the code in place, but my ContentLoader won't open my file...

Basically, my directory looks like this:

    //WindowsGame1
- "Game1.cs"
- //Classes
- "NPC.cs"
- Content Reference
- //Images
- "Monster.png"


Inside my NPC class, I have all the essential drawing functions, i.e. LoadContent, Draw, Update. And I can get the game to find the correct file and attempt to open it, but when it tries, it throws an exception and tells me it can't open the file. This is how my code in my NPC class looks:

    Texture2D NPCImage;
Vector2 NPCPosition;
Animation NPCAnimation = new Animation();

public void Initialize()
{
NPCAnimation.Initialize(NPCPosition, new Vector2(4, 4));
}

{
NPCAnimation.AnimationImage = NPCImage;
}


The rest of the code is irrelevant at this point because I can't even get the image to load. I think it might have to do with a directory problem, but I also know little to nothing about spriting or working with images or animations in my code. Any help is appreciated. Not sure if I provided enough information here, so let me know if more is needed! Also, what would be the correct way to direct that Content.Load to Monster.png given the current directory situation? Right now I just have it using the full path from the C:// drive. Thanks in advance!

• Actually what you insert in InsertImageFilePathHere is the path and assetname, in your case it would be "Images/Monster" because XNA would just trim the .png and use "Monster" as the default assetname – Blu3 Jun 30 '13 at 11:33
• Is that my problem though? – PorkchopDonut Jun 30 '13 at 17:07
• What does the exception actually say? – Andrew Russell Jul 1 '13 at 4:36
• An unhandled exception of type 'Microsoft.Xna.Framework.Content.ContentLoadException' occurred in Microsoft.Xna.Framework.dll Additional information: Error loading "C:\Users\Donutdood\Documents\Visual Studio 2012\Projects\SwagDungeon\SwagDungeonStuff\Resources\Monsters\Boulder\Walking". Cannot open file. – PorkchopDonut Jul 1 '13 at 16:01