Menu system
Hi
What's the best way of dealing with game states?
I'm leaning on having a system like this:
gameLoop(){
while(true){
if (gameState == GameState.INGAME){
updateGameObjects();
drawGame();
}
elseif (gameState == GameState.MENU){
drawMenu();
}
}
keyPressed(){
if (gameState == GameState.INGAME){
If uparrow is pressed move player up
}
elseif (gameState == GameState.MENU){
If uparrow is pressed select menu item above
}
}
Or what do you think is the best way? Maybe having a launcher window instead of ingame menus?
Looking forward to see lots of opinios here.

