views:

139

answers:

1

i am expanding on the XNA game studio 2D tutorial and adding menus from the microsoft XNA Game studio website. i thought it would be just plug in and run, but is much more complicated than i thought. here is one error, i will post more as i get them. Here is the debug window:

C:\Users\Ian\Desktop\GameStateManagementSample - Copy\GameStateManagement\Screens\GameplayScreen.cs(81,24): error CS1502: The best overloaded method match for 'Microsoft.Xna.Framework.GraphicsDeviceManager.GraphicsDeviceManager(Microsoft.Xna.Framework.Game)' has some invalid arguments C:\Users\Ian\Desktop\GameStateManagementSample - Copy\GameStateManagement\Screens\GameplayScreen.cs(81,50): error CS1503: Argument '1': cannot convert from 'GameStateManagement.GameplayScreen' to 'Microsoft.Xna.Framework.Game'

Compile complete -- 2 errors, 0 warnings ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

And here is the code:

public GameplayScreen()

        {
            //new GraphicsDeviceManager(this) has the error line under it!!!
            graphics = new GraphicsDeviceManager(this);
            content.RootDirectory = "Content";
        }
+3  A: 

You need to pass the constructor for GraphicsDeviceManager a valid Microsoft.Xna.Framework.Game object instead of the current class using this

Also, a walkthrough that may be helpful to create your first game

Chris Ballance