CurrentScreen in MainMenu case

I noticed that when I tried to go back to the main menu while I was being prompted to enter a password, that I would go back to the main menu but it would still be stuck on the password enum. To fix it I added the enum to the menu case like this :

        if (input == "menu")
        {
            currentScreen = Screen.MainMenu;    // this is what I added
            level = 0;
            ShowMainMenu();
            
        }

Now when I escape to the main menu for whatever reason, the enum updates correctly. It may be addressed later in the course, but I haven’t gone much further yet.

2 Likes


I think it would be better to insert this code in ShowMainMenu() class, like in my example, look line 18, because when you type word “menu”, your function directs you to ShowMainMenu, so, when you are there, it’s the best time to declare that user is in MainMenu screen. I just started the course couple days ago, maybe i’m not right, but I hope that my version is a little bit better and I helped xD If no, let me know pls)

2 Likes

I did that too. Hopefully it will be done in the future.

Ben addressed it in lecture 25 i think.
See the changes he made here on github

Privacy & Terms