So I need a c# if()
statement which should look something like this, maybe? Code:
...
if(CurrentGameState != gameState.gameLoading && gameState.mainMenu && keyboardState.IsKeyDown(Keys.Escape))
{
CurrentGameState = gameState.mainmenu;
}
//I get error in: CurrentGameState != gameState.gameLoading && gameState.mainMenu part
...
And that's the code I have used the variables above from:
//Game States
enum gameState
{
gameLoading,
mainMenu,
gameOptions,
levelSelect,
gamePlaying,
gameOver
}
gameState CurrentGameState = gameState.gameLoading;
//Keyboard State
KeyboardState keyboardState = Keyboard.GetState();
Any suggestions?
gameState.mainMenu
is an enum value, not a boolean value. You can't use it the way you're trying to. Did you mean to do this?