所以我需要 ac#if()
语句,它应该看起来像这样,也许?代码:
...
if(CurrentGameState != gameState.gameLoading && gameState.mainMenu && keyboardState.IsKeyDown(Keys.Escape))
{
CurrentGameState = gameState.mainmenu;
}
//I get error in: CurrentGameState != gameState.gameLoading && gameState.mainMenu part
...
这就是我使用上述变量的代码:
//Game States
enum gameState
{
gameLoading,
mainMenu,
gameOptions,
levelSelect,
gamePlaying,
gameOver
}
gameState CurrentGameState = gameState.gameLoading;
//Keyboard State
KeyboardState keyboardState = Keyboard.GetState();
有什么建议么?