For example: press button B to pause the game until a I press another button to start it again…
You use the menu button.
No, I don’t know the keybind for it.
lol I didn’t notice the menu button…
To add to this:
When you call
pushScene(), all of your sprites, tilemaps, and game update code will be hidden away and paused until you call
popScene(). Then, any new sprites you created in the meantime will get deleted and you’ll return to the paused game.
This is how the menu button works “under the hood”. You can also override the menu by registering a button event for it.