Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programming Problems
#5
Currently it looks like this in Game1.cs:

Code:
public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;      
        Wizard mWizardSprite;

I swapped it with:

Code:
public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;      
        Wizard Wizard;

And then just went on to replace every other instance of 'mWizardSprite' with 'Wizard'. It works perfectly fine.

However, when I change the definition back to Wizard mWizardSprite (only the definition, leaving everything else as Wizard), the intialize method says that there's a problem. Apparently 'WindowsGame11.Wizard' is a 'type' but is used like a 'variable'. What does this error mean?

I know how to solve it (I have to change all the corresponding commands (that referred to Wizard) to instead refer to mWizardSprite once again since I changed the definition back) but I don't understand what C# is trying to tell me is happening in its error message. I googled the error message, but still am not sure what it's supposed to mean. The error message occurs in the following line of coding:

Code:
protected override void Initialize()
        {
            // TODO: Add your initialization logic here            
            mWizardSprite = new Wizard();
Reply


Messages In This Thread
Programming Problems - by Haseo - 2011-07-30, 06:47 AM
Programming Problems - by Unauthorized Intruder - 2011-07-30, 07:59 AM
Programming Problems - by Haseo - 2011-07-30, 08:22 AM
Programming Problems - by Unauthorized Intruder - 2011-07-30, 09:03 AM
Programming Problems - by Haseo - 2011-07-30, 09:19 AM
Programming Problems - by Unauthorized Intruder - 2011-07-30, 10:29 AM
Programming Problems - by Stereo - 2011-07-31, 06:53 AM
Programming Problems - by Haseo - 2011-07-31, 07:29 AM
Programming Problems - by Spaz - 2011-07-31, 03:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)