One of my game states is being skipped (pressing space goes straight to the 'GameScreen' game state skipping the 'CharSelect' state). All help is appreciated.
if (currentGameState == GameState.TitleScreen)
{
if (keyboard.IsKeyDown(Keys.Space))
{
currentGameState = GameState.CharacterSelect;
testFontTitle = "CharSelect";
changedstate = true;
}
if (keyboard.IsKeyDown(Keys.Escape))
{
this.Exit();
}
}
else if (currentGameState == GameState.CharacterSelect)
{
if (keyboard.IsKeyDown(Keys.Space))
{
currentGameState = GameState.GameScreen;
testFontTitle = "GameScreen";
changedstate = true;
}
if (keyboard.IsKeyDown(Keys.Escape))
{
currentGameState = GameState.TitleScreen;
testFontTitle = "Title";
changedstate = true;
}
}
// TODO: Add your update logic here
base.Update(gameTime);
}