Sign in to follow this  

XNA Gamestates

This topic is 3661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For some reason when I add this line of code from the previous project that was linked, I get an error saying that it must have a return type. It worked in the project I got it from, however... Anyone know what could be wrong?

public GameStateManagementGame()
{
graphics = new GraphicsDeviceManager(this);

graphics.PreferredBackBufferWidth = 853;
graphics.PreferredBackBufferHeight = 480;

// Create the screen manager component.
screenManager = new ScreenManager(this);

Components.Add(screenManager);

// Activate the first screens.
screenManager.AddScreen(new BackgroundScreen());
screenManager.AddScreen(new MainMenuScreen());
}

Share this post


Link to post
Share on other sites
Quote:
Original post by Sylvain Bories
Hello,

Is the class name the same as the class constructor (GameStateManagementGame...)? This kind of error may come from that.

Sylvain.


Nope, I used the same class names as the code in the previous link. There is no class named GameStateManagementGame.

Thanks for asking though

Share this post


Link to post
Share on other sites
Quote:
Original post by rippingcorpse
Quote:
Original post by Sylvain Bories
Hello,

Is the class name the same as the class constructor (GameStateManagementGame...)? This kind of error may come from that.

Sylvain.


Nope, I used the same class names as the code in the previous link. There is no class named GameStateManagementGame.

Thanks for asking though


Then you either need to rename it to the same name as the class it's a part of (if you wish it to be a constructor) or give it a return type (void if you don't want it to return anything).

Share this post


Link to post
Share on other sites

This topic is 3661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this