I've been trying out cc for a few days and I have been trying to make a pause menu.
I have it so on pressing esc it changes a global variable and have stuff happen based on it changing.
The problem I am having is the frst tme i press esc the pause menu flashes up for an instant then dissappears but the next time I press esc it works as intended. I hope I can get some help.
Develop games in your browser. Powerful, performant & highly capable.
It's impossible to tell without the code at hand. Try to incorporate a timer which prevents closing the pause menu until after, say, 200 ms or so. This should fix whatever is wrong with it.
-> start timer
-> open pause menu
Timer is 200 ms or above AND Esc pressed:
-> close pause menu